From: Todd C. Miller Date: Sun, 6 Jun 2004 19:54:23 +0000 (+0000) Subject: Add do {} while(0) around pop macro X-Git-Tag: SUDO_1_6_8~76 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e73e5c38c630a50b1d9463a178d70de00296338;p=sudo Add do {} while(0) around pop macro Set cmnd_matches to UNSPEC, not NOMATCH when resetting it. --- diff --git a/parse.yacc b/parse.yacc index b5e878213..b2e2bc8b1 100644 --- a/parse.yacc +++ b/parse.yacc @@ -142,12 +142,12 @@ int top = 0, stacksize = 0; } while (0) #define pop \ - { \ + do { \ if (top == 0) \ yyerror("matching stack underflow"); \ else \ top--; \ - } + } while (0) /* * Shortcuts for append() @@ -433,7 +433,7 @@ cmndspeclist : cmndspec cmndspec : runasspec cmndtag opcmnd { /* * Push the entry onto the stack if it is worth - * saving and clear cmnd_matches for next cmnd. + * saving and reset cmnd_matches for next cmnd. * * We need to save at least one entry on * the stack so sudoers_lookup() can tell that @@ -453,7 +453,7 @@ cmndspec : runasspec cmndtag opcmnd { pushcp; else if (user_matches == TRUE && keepall) pushcp; - cmnd_matches = NOMATCH; + cmnd_matches = UNSPEC; } ;