[Libguestfs] [PATCH] builder: fix small regression in subkey parsing

Pino Toscano ptoscano at redhat.com
Wed Jan 22 14:36:03 UTC 2014


Introduced in 5cbdf35d651b6c730d62d9af4876039faa122efc, it caused the
first character of the value to be skipped if the key has a subkey.
---
 builder/index-scan.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builder/index-scan.l b/builder/index-scan.l
index 7a9618f..e43f82e 100644
--- a/builder/index-scan.l
+++ b/builder/index-scan.l
@@ -65,7 +65,7 @@ extern void yyerror (const char *);
                       if (yytext[i] == '[') {
                         size_t j = strcspn (yytext+i+1, "]");
                         yylval.field->subkey = strndup (yytext+i+1, j);
-                        i += 1+j+2;
+                        i += 1+j+1;
                       } else {
                         yylval.field->subkey = NULL;
                       }
-- 
1.8.3.1




More information about the Libguestfs mailing list