]> granicus.if.org Git - sudo/commitdiff
now use a 'hook' expression instead of an iffy one :-)
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 3 Feb 1996 01:48:30 +0000 (01:48 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 3 Feb 1996 01:48:30 +0000 (01:48 +0000)
parse.yacc

index 571741afa7f1bc4b1e080d3a23684c7d0314ff78..91be0a126aefbba900e1175bb5d31e62026e9665 100644 (file)
@@ -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++)