]> git.ipfire.org Git - pakfire.git/commitdiff
libpakfire: parser: Remove quotes around quoted strings
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Mar 2019 13:51:02 +0000 (13:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Mar 2019 13:51:02 +0000 (13:51 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/parser/scanner.l

index bd77566eef188a010fc9568889bea1a040a3a432..6af06687080b1227f503fa188eeab1a6c54b5b3a 100644 (file)
@@ -54,6 +54,15 @@ word                 ({quoted_string}|({digit}|{letter}|{special})+)
 "def"                  { return DEFINE; }
 "end"                  { return END; }
 
+{quoted_string}        {
+                                       // Remove quotes
+                                       size_t len = strlen(yytext);
+                                       yytext[len-1] = '\0';
+
+                                       yylval.string = pakfire_strdup(yytext + 1);
+                                       return WORD;
+                               }
+
 {word}                 {
                                        yylval.string = pakfire_strdup(yytext);
                                        return WORD;