]> git.ipfire.org Git - pakfire.git/commitdiff
libpakfire: parser: Do not allow words to be empty (removes a shift/reduce error)
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 Mar 2019 10:05:43 +0000 (10:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 Mar 2019 10:05:43 +0000 (10:05 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/parser/grammar.y

index 0288a9c0984b68f4fbfd34073e0a4b3d2f150c1b..af0fadccc5a2db0363f40c3b439bd0dd9953f086 100644 (file)
@@ -112,16 +112,15 @@ words                                             : WORD
                                                                        ERROR(pakfire, "Could not allocate memory");
                                                                        ABORT;
                                                                }
-                                                       }
-                                                       | /* empty */
-                                                       {
-                                                               $$ = NULL;
                                                        };
 
 line                                           : whitespace words NEWLINE
                                                        {
                                                                // Only forward words
                                                                $$ = $2;
+                                                       }
+                                                       | whitespace NEWLINE {
+                                                               $$ = NULL;
                                                        };
 
 text                                           : text line