From: Todd C. Miller Date: Sat, 3 Feb 1996 01:48:30 +0000 (+0000) Subject: now use a 'hook' expression instead of an iffy one :-) X-Git-Tag: SUDO_1_5_0~296 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42225e3b0d3c6ff354ec853f71df971e032ee552;p=sudo now use a 'hook' expression instead of an iffy one :-) --- diff --git a/parse.yacc b/parse.yacc index 571741afa..91be0a126 100644 --- a/parse.yacc +++ b/parse.yacc @@ -267,15 +267,10 @@ cmnd : ALL { | COMMAND { char **t; - /* XXX - use '?' operator */ - if (NewArgc > 1) { - if (path_matches(cmnd, &NewArgv[1], $1.cmnd, - $1.args)) - cmnd_matches = TRUE; - else if (path_matches(cmnd, NULL, $1.cmnd, - $1.args)) - cmnd_matches = TRUE; - } + /* if NewArgc > 1 pass ptr to 1st arg, else NULL */ + if (path_matches(cmnd, (NewArgc > 1) ? &NewArgv[1] + : NULL, $1.cmnd, $1.args)) + cmnd_matches = TRUE; (void) free($1.cmnd); for (t = $1.args; t && *t; t++)