mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-04 09:09:56 +00:00
Fix from Keith Bostic <bostic@bsdi.com> for bug in sed dealing with
continuation lines. Submitted by: Keith Bostic via Kirk McKusick
This commit is contained in:
parent
0bff613275
commit
796d43185d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16510
@ -615,7 +615,7 @@ compile_tr(p, transtab)
|
||||
static char *
|
||||
compile_text()
|
||||
{
|
||||
int asize, size;
|
||||
int asize, esc_nl, size;
|
||||
char *text, *p, *op, *s;
|
||||
char lbuf[_POSIX2_LINE_MAX + 1];
|
||||
|
||||
@ -626,13 +626,15 @@ compile_text()
|
||||
op = s = text + size;
|
||||
p = lbuf;
|
||||
EATSPACE();
|
||||
for (; *p; p++) {
|
||||
if (*p == '\\')
|
||||
p++;
|
||||
for (esc_nl = 0; *p != '\0'; p++) {
|
||||
if (*p == '\\' && *p++ == '\0') {
|
||||
esc_nl = 1;
|
||||
break;
|
||||
}
|
||||
*s++ = *p;
|
||||
}
|
||||
size += s - op;
|
||||
if (p[-2] != '\\') {
|
||||
if (!esc_nl) {
|
||||
*s = '\0';
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user