Return to compile.c CVS log | Up to [local] / src / usr.bin / sed |
version 1.3, 1997/04/28 20:23:19 | version 1.4, 1997/11/14 03:59:25 | ||
---|---|---|---|
|
|
||
static char * | static char * | ||
compile_text() | compile_text() | ||
{ | { | ||
int asize, size; | int asize, esc_nl, size; | ||
char *text, *p, *op, *s; | char *text, *p, *op, *s; | ||
char lbuf[_POSIX2_LINE_MAX + 1]; | char lbuf[_POSIX2_LINE_MAX + 1]; | ||
|
|
||
op = s = text + size; | op = s = text + size; | ||
p = lbuf; | p = lbuf; | ||
EATSPACE(); | EATSPACE(); | ||
for (; *p; p++) { | for (esc_nl = 0; *p != '\0'; p++) { | ||
if (*p == '\\') | if (*p == '\\' && p[1] != '\0' && *++p == '\n') | ||
p++; | esc_nl = 1; | ||
*s++ = *p; | *s++ = *p; | ||
} | } | ||
size += s - op; | size += s - op; | ||
if (p[-2] != '\\') { | if (!esc_nl) { | ||
*s = '\0'; | *s = '\0'; | ||
break; | break; | ||
} | } |