version 1.3, 2007/07/08 17:44:20 |
version 1.4, 2007/07/08 17:53:15 |
|
|
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 |
* |
* |
|
|
* |
* |
* 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; |
} |
} |
|
|
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; |
} |
} |
|
|