BR 1582430: Allow numbers with leading + or - for %ifnum

Allow numbers with a leading + or - to return true for %ifnum.
This commit is contained in:
H. Peter Anvin 2008-02-16 13:44:52 -08:00
parent 373281afde
commit 927c92b478

@ -1584,13 +1584,17 @@ static bool if_condition(Token * tline, enum preproc_token ct)
goto iftype;
iftype:
tline = expand_smacro(tline);
t = tline;
while (tok_type_(t, TOK_WHITESPACE))
t = t->next;
j = false; /* placate optimiser */
if (t)
j = t->type == needtype;
tline = expand_smacro(tline);
t = tline;
while (tok_type_(t, TOK_WHITESPACE) ||
(needtype == TOK_NUMBER &&
tok_type_(t, TOK_OTHER) &&
(t->text[0] == '-' || t->text[0] == '+') &&
!t->text[1]))
t = t->next;
j = t && t->type == needtype;
break;
case PPC_IF: