]> granicus.if.org Git - sudo/commitdiff
took out support for quoted commands since there is no need...
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 2 Feb 1996 04:53:24 +0000 (04:53 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 2 Feb 1996 04:53:24 +0000 (04:53 +0000)
parse.lex

index fbbbdbaff4e57a11e9f7e4a89f037b6a09d0c77d..7f4469c090d823b5e86d54d6e87e247155eeee9e 100644 (file)
--- a/parse.lex
+++ b/parse.lex
@@ -83,7 +83,6 @@ N                     [0-9][0-9]?[0-9]?
 %k     3500
 
 %s     GOTCMND
-%s     QUOTEDCMND
 
 %%
 [ \t]+                 {                       /* throw away space/tabs */
@@ -96,18 +95,7 @@ N                    [0-9][0-9]?[0-9]?
                            LEXTRACE("\n\t");
                        }                       /* throw away EOL after \ */
 
-<QUOTEDCMND>\\\"       {
-                           LEXTRACE("QUOTEDCHAR ");
-                           fill_args("\"", 1, sawspace);      
-                           sawspace = FALSE;
-                       }
-
-<QUOTEDCMND>\"         {
-                           BEGIN 0;
-                           return(COMMAND);
-                       }                       /* end of command line args */
-
-<GOTCMND>\\[:\,=\\]    {
+<GOTCMND>\\[:\,=\\ \t] {
                            LEXTRACE("QUOTEDCHAR ");
                            fill_args(yytext + 1, 1, sawspace);
                            sawspace = FALSE;
@@ -131,13 +119,7 @@ N                  [0-9][0-9]?[0-9]?
                            return(COMMENT);
                        }                       /* return comments */
 
-<QUOTEDCMND>[^\" \t\n#]+ {
-                           LEXTRACE("ARG ");
-                           fill_args(yytext, yyleng, sawspace);
-                           sawspace = FALSE;
-                         }                     /* a command line arg */
-
-<GOTCMND>[^\,:=\\ \t\n#]+ {
+<GOTCMND>[^:\,= \t\n#]+ {
                            LEXTRACE("ARG ");
                            fill_args(yytext, yyleng, sawspace);
                            sawspace = FALSE;
@@ -181,31 +163,16 @@ N                 [0-9][0-9]?[0-9]?
                            return(NTWKADDR);
                        }
 
-\"?\/[^\,:=\\ \t\n#]+  {
-                           /* command may be quoted */
-                           if (yytext[0] == '"') {
-                               /* may not have args so has endquote */
-                               if (yytext[yyleng - 1] == '"' &&
-                                   yytext[yyleng - 2] != '\\') {
-                                   LEXTRACE("COMMAND ");
-                                   fill_cmnd(yytext + 1, yyleng - 2);
-                                   return(COMMAND);
-                               } else {
-                                   BEGIN QUOTEDCMND;
-                                   LEXTRACE("COMMAND ");
-                                   fill_cmnd(yytext + 1, yyleng - 1);
-                               }
+\/[^\,:=\\ \t\n#]+     {
+                           /* directories can't have args... */
+                           if (yytext[yyleng - 1] == '/') {
+                               LEXTRACE("COMMAND ");
+                               fill_cmnd(yytext, yyleng);
+                               return(COMMAND);
                            } else {
-                               /* directories can't have args... */
-                               if (yytext[yyleng - 1] == '/') {
-                                   LEXTRACE("COMMAND ");
-                                   fill_cmnd(yytext, yyleng);
-                                   return(COMMAND);
-                               } else {
-                                   BEGIN GOTCMND;
-                                   LEXTRACE("COMMAND ");
-                                   fill_cmnd(yytext, yyleng);
-                               }
+                               BEGIN GOTCMND;
+                               LEXTRACE("COMMAND ");
+                               fill_cmnd(yytext, yyleng);
                            }
                        }                       /* a pathname */