[BACK]Return to parse.y CVS log [TXT][DIR] Up to [local] / src / usr.bin / doas

Diff for /src/usr.bin/doas/parse.y between version 1.17 and 1.18

version 1.17, 2016/06/07 14:11:16 version 1.18, 2016/06/07 16:49:23
Line 111 
Line 111 
                                         $$.envlist = $2.envlist;                                          $$.envlist = $2.envlist;
                         }                          }
                 } ;                  } ;
   
 option:         TNOPASS {  option:         TNOPASS {
                         $$.options = NOPASS;                          $$.options = NOPASS;
                 } | TKEEPENV {                  } | TKEEPENV {
Line 131 
Line 130 
                                 errx(1, "can't allocate envlist");                                  errx(1, "can't allocate envlist");
                         $$.envlist[nenv] = $2.str;                          $$.envlist[nenv] = $2.str;
                         $$.envlist[nenv + 1] = NULL;                          $$.envlist[nenv + 1] = NULL;
                 } | envlist TSTRING '=' TSTRING {  
                         int nenv = arraylen($1.envlist);  
                         char *cp = NULL;  
   
                         if (*$2.str == '\0' || strchr($2.str, '=') != NULL) {  
                                 yyerror("invalid setenv expression");  
                                 YYERROR;  
                         }  
                         if (!($$.envlist = reallocarray($1.envlist,  
                             nenv + 2, sizeof(char *))))  
                                 errx(1, "can't allocate envlist");  
                         $$.envlist[nenv] = NULL;  
                         if (asprintf(&cp, "%s=%s", $2.str, $4.str) <= 0 ||  
                             cp == NULL)  
                                 errx(1,"asprintf failed");  
                         $$.envlist[nenv] = cp;  
                         $$.envlist[nenv + 1] = NULL;  
                 }                  }
   
   
 ident:          TSTRING {  ident:          TSTRING {
                         $$.str = $1.str;                          $$.str = $1.str;
                 } ;                  } ;
Line 236 
Line 219 
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case '{':                  case '{':
                 case '}':                  case '}':
                 case '=':  
                         return c;                          return c;
                 case '#':                  case '#':
                         /* skip comments; NUL is allowed; no continuation */                          /* skip comments; NUL is allowed; no continuation */
Line 289 
Line 271 
                 case '#':                  case '#':
                 case ' ':                  case ' ':
                 case '\t':                  case '\t':
                 case '=':  
                         if (!escape && !quotes)                          if (!escape && !quotes)
                                 goto eow;                                  goto eow;
                         break;                          break;

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