version 1.18, 2004/06/13 17:11:17 |
version 1.19, 2004/07/09 19:39:40 |
|
|
static char lbuf[_POSIX2_LINE_MAX + 1]; |
static char lbuf[_POSIX2_LINE_MAX + 1]; |
int asize, ref, size; |
int asize, ref, size; |
char c, *text, *op, *sp; |
char c, *text, *op, *sp; |
|
int sawesc = 0; |
|
|
c = *p++; /* Terminator character */ |
c = *p++; /* Terminator character */ |
if (c == '\0') |
if (c == '\0') |
|
|
do { |
do { |
op = sp = text + size; |
op = sp = text + size; |
for (; *p; p++) { |
for (; *p; p++) { |
if (*p == '\\') { |
if (*p == '\\' || sawesc) { |
p++; |
/* |
if (strchr("123456789", *p) != NULL) { |
* If this is a continuation from the last |
|
* buffer, we won't have a character to |
|
* skip over. |
|
*/ |
|
if (sawesc) |
|
sawesc = 0; |
|
else |
|
p++; |
|
|
|
if (*p == '\0') { |
|
/* |
|
* This escaped character is continued |
|
* in the next part of the line. Note |
|
* this fact, then cause the loop to |
|
* exit w/ normal EOL case and reenter |
|
* above with the new buffer. |
|
*/ |
|
sawesc = 1; |
|
p--; |
|
continue; |
|
} else if (strchr("123456789", *p) != NULL) { |
*sp++ = '\\'; |
*sp++ = '\\'; |
ref = *p - '0'; |
ref = *p - '0'; |
if (s->re != NULL && |
if (s->re != NULL && |