Use ? in path matching to avoid /* trap.

This commit is contained in:
Pavel Machek 2000-05-25 14:58:38 +00:00
parent ba1dda495a
commit 9a09a64bb4
3 changed files with 4 additions and 4 deletions

View file

@ -139,7 +139,7 @@ WHITE [ \t]
return CLI_MARKER; return CLI_MARKER;
} }
[={}:;,()+*/%-<>~\[\]] { [={}:;,()+*/%-<>~\[\]?] {
return yytext[0]; return yytext[0];
} }

View file

@ -277,7 +277,7 @@ switch_body: /* EMPTY */ { $$ = NULL; }
bgp_one: bgp_one:
NUM { $$ = $1; } NUM { $$ = $1; }
| '*' { $$ = PM_ANY; } | '?' { $$ = PM_ANY; }
; ;
bgp_path: bgp_path:

View file

@ -45,8 +45,8 @@ clist l;
print "4 = ", p2.len; print "4 = ", p2.len;
p2 = prepend( p2, 5 ); p2 = prepend( p2, 5 );
print "Should be false: ", p2 ~ p; print "Should be false: ", p2 ~ p;
print "Should be true: ", p2 ~ / * 4 3 2 1 /, p2, / * 4 3 2 1 /; print "Should be true: ", p2 ~ / ? 4 3 2 1 /, p2, / ? 4 3 2 1 /;
print "Should be true: ", p2 ~ / * 4 3 * 1 /, p2, / * 4 3 * 1 /; print "Should be true: ", p2 ~ / ? 4 3 ? 1 /, p2, / ? 4 3 ? 1 /;
print "5 = ", p2.len; print "5 = ", p2.len;
l = - empty -; l = - empty -;