diff options
author | David Greenman <dg@FreeBSD.org> | 1996-06-26 05:54:32 +0000 |
---|---|---|
committer | David Greenman <dg@FreeBSD.org> | 1996-06-26 05:54:32 +0000 |
commit | 4f587766449daeb0467d4f6b4605693d9b00c04f (patch) | |
tree | 56d8fcb536e158da59c7749832d4099648b2e806 | |
parent | 4b83b27fea586d38b52dfea077c381a4249aa477 (diff) | |
download | src-4f587766449daeb0467d4f6b4605693d9b00c04f.tar.gz src-4f587766449daeb0467d4f6b4605693d9b00c04f.zip |
Notes
-rw-r--r-- | usr.bin/sed/compile.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index b793d08ced8d..7e113823a66f 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -615,7 +615,7 @@ compile_tr(p, transtab) static char * compile_text() { - int asize, esc_nl, size; + int asize, size; char *text, *p, *op, *s; char lbuf[_POSIX2_LINE_MAX + 1]; @@ -626,15 +626,13 @@ compile_text() op = s = text + size; p = lbuf; EATSPACE(); - for (esc_nl = 0; *p != '\0'; p++) { - if (*p == '\\' && *p++ == '\0') { - esc_nl = 1; - break; - } + for (; *p != '\0'; p++) { + if (*p == '\\') + *p++ = '\0'; *s++ = *p; } size += s - op; - if (!esc_nl) { + if (p[-2] != '\0') { *s = '\0'; break; } |