[BACK]Return to compile.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sed

Diff for /src/usr.bin/sed/compile.c between version 1.3 and 1.4

version 1.3, 1997/04/28 20:23:19 version 1.4, 1997/11/14 03:59:25
Line 618 
Line 618 
 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];
   
Line 629 
Line 629 
                 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;
                 }                  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4