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

Richard W.M. Jones rjones at redhat.com
Wed Jan 22 15:34:49 UTC 2014


On Wed, Jan 22, 2014 at 03:36:03PM +0100, Pino Toscano wrote:
> 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

ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list