diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-07-31 06:56:22 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-07-31 06:56:22 +0200 |
commit | b4c1cf2ea1220698c00fa2692477505e20431bb0 (patch) | |
tree | ba270ad920cb47099f57df798ec7eb26d9a3e538 /sys/src/libregexp | |
parent | 6e65596827f7ee292221697ff5248c9bc9520851 (diff) |
libregexp: fix lexer so it doesnt move past the string when it gets a \ escape
Diffstat (limited to 'sys/src/libregexp')
-rw-r--r-- | sys/src/libregexp/regcomp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/src/libregexp/regcomp.c b/sys/src/libregexp/regcomp.c index 094f94779..c7b3b9b87 100644 --- a/sys/src/libregexp/regcomp.c +++ b/sys/src/libregexp/regcomp.c @@ -312,13 +312,10 @@ getnextr(Parselex *l) return; } l->rawexp += chartorune(&l->rune, l->rawexp); - if(l->rune == L'\\') { - l->rawexp += chartorune(&l->rune, l->rawexp); - l->literal = 1; - } if(*l->rawexp == 0) l->done = 1; - return; + if(l->rune == L'\\') + getnextrlit(l); } static void @@ -333,7 +330,6 @@ getnextrlit(Parselex *l) l->rawexp += chartorune(&l->rune, l->rawexp); if(*l->rawexp == 0) l->done = 1; - return; } static int |