Fix bug with references to root node

At present, the lexer token for references to a path doesn't permit a
reference to the root node &{/}.  Fixing the lexer exposes another bug
handling this case.

This patch fixes both bugs and adds testcases.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2014-05-09 20:48:49 +10:00
parent 55a3a8823d
commit f240527e54
8 changed files with 48 additions and 2 deletions

View file

@ -193,7 +193,7 @@ static void lexical_error(const char *fmt, ...);
return DT_REF;
}
<*>"&{/"{PATHCHAR}+\} { /* new-style path reference */
<*>"&{/"{PATHCHAR}*\} { /* new-style path reference */
yytext[yyleng-1] = '\0';
DPRINT("Ref: %s\n", yytext+2);
yylval.labelref = xstrdup(yytext+2);