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

Diff for /src/usr.bin/make/parsevar.c between version 1.3 and 1.4

version 1.3, 2007/07/08 17:44:20 version 1.4, 2007/07/08 17:53:15
Line 172 
Line 172 
     if (type & VAR_SUBST) {      if (type & VAR_SUBST) {
         /*          /*
          * Allow variables in the old value to be undefined, but leave their           * Allow variables in the old value to be undefined, but leave their
          * invocation alone -- this is done by forcing oldVars to be false.           * invocation alone -- this is done by forcing errorIsOkay to be false.
          * XXX: This can cause recursive variables, but that's not hard to do,           * XXX: This can cause recursive variables, but that's not hard to do,
          * and this allows someone to do something like           * and this allows someone to do something like
          *           *
Line 181 
Line 181 
          *           *
          * And not get an error.           * And not get an error.
          */           */
         bool   oldOldVars = oldVars;          bool   saved = errorIsOkay;
   
         oldVars = false;          errorIsOkay = false;
         /* ensure the variable is set to something to avoid `variable          /* ensure the variable is set to something to avoid `variable
          * is recursive' errors.  */           * is recursive' errors.  */
         if (Var_Valuei(name.s, name.e) == NULL)          if (Var_Valuei(name.s, name.e) == NULL)
             Var_Seti(name.s, name.e, "", ctxt);              Var_Seti(name.s, name.e, "", ctxt);
   
         res2 = Var_Subst(arg, NULL, false);          res2 = Var_Subst(arg, NULL, false);
         oldVars = oldOldVars;          errorIsOkay = saved;
   
         arg = res2;          arg = res2;
     }      }
Line 216 
Line 216 
 Parse_CmdlineVar(const char *line)  Parse_CmdlineVar(const char *line)
 {  {
         bool result;          bool result;
           bool saved = errorIsOkay;
   
         oldVars = false;          errorIsOkay = false;
         result = parse_variable_assignment(line, VAR_CMD);          result = parse_variable_assignment(line, VAR_CMD);
         oldVars = true;          errorIsOkay = errorIsOkay;
         return result;          return result;
 }  }
   

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