summaryrefslogtreecommitdiff
path: root/sys/src/libregexp
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2017-07-31 06:56:22 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2017-07-31 06:56:22 +0200
commitb4c1cf2ea1220698c00fa2692477505e20431bb0 (patch)
treeba270ad920cb47099f57df798ec7eb26d9a3e538 /sys/src/libregexp
parent6e65596827f7ee292221697ff5248c9bc9520851 (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.c8
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