[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.18 and 1.19

version 1.18, 2004/06/13 17:11:17 version 1.19, 2004/07/09 19:39:40
Line 440 
Line 440 
         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')
Line 453 
Line 454 
         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 &&

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19