[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.42 and 1.43

version 1.42, 2017/08/01 18:05:53 version 1.43, 2017/12/08 18:41:59
Line 277 
Line 277 
                         pledge_rpath = 1;                          pledge_rpath = 1;
                         p++;                          p++;
                         EATSPACE();                          EATSPACE();
                           if (*p == '\0')
                                   error(COMPILE, "filename expected");
                         cmd->t = duptoeol(p, "read command", NULL);                          cmd->t = duptoeol(p, "read command", NULL);
                         break;                          break;
                 case BRANCH:                    /* b t */                  case BRANCH:                    /* b t */
Line 539 
Line 541 
 {  {
         int gn;                 /* True if we have seen g or n */          int gn;                 /* True if we have seen g or n */
         long l;          long l;
         char wfile[PATH_MAX], *q, *eq;  
   
         s->n = 1;                               /* Default */          s->n = 1;                               /* Default */
         s->p = 0;          s->p = 0;
Line 577 
Line 578 
                         continue;                          continue;
                 case 'w':                  case 'w':
                         p++;                          p++;
 #ifdef HISTORIC_PRACTICE  
                         if (*p != ' ') {  
                                 warning("space missing before w wfile");  
                                 return (p);  
                         }  
 #endif  
                         EATSPACE();                          EATSPACE();
                         q = wfile;                          if (*p == '\0')
                         eq = wfile + sizeof(wfile) - 1;                                  error(COMPILE, "filename expected");
                         while (*p) {                          s->wfile = duptoeol(p, "s command w flag", NULL);
                                 if (*p == '\n')                          *p = '\0';
                                         break;  
                                 if (q >= eq)  
                                         error(COMPILE, "wfile too long");  
                                 *q++ = *p++;  
                         }  
                         *q = '\0';  
                         if (q == wfile)  
                                 error(COMPILE, "no wfile specified");  
                         s->wfile = strdup(wfile);  
                         if (aflag)                          if (aflag)
                                 pledge_wpath = 1;                                  pledge_wpath = 1;
                         else if ((s->wfd = open(wfile,                          else if ((s->wfd = open(s->wfile,
                             O_WRONLY|O_APPEND|O_CREAT|O_TRUNC,                              O_WRONLY|O_APPEND|O_CREAT|O_TRUNC,
                             DEFFILEMODE)) == -1)                              DEFFILEMODE)) == -1)
                                 error(FATAL, "%s: %s", wfile, strerror(errno));                                  error(FATAL, "%s: %s", s->wfile, strerror(errno));
                         return (p);                          return (p);
                 default:                  default:
                         error(COMPILE,                          error(COMPILE,

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43