ref: 5a661a3c685d587311dc3bc14f7254390d15868a
parent: 848dfff2beb572eebc96a03df2b15f318373b5ba
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jul 31 02:56:22 EDT 2017
libregexp: fix lexer so it doesnt move past the string when it gets a \ escape
--- a/sys/src/libregexp/regcomp.c
+++ b/sys/src/libregexp/regcomp.c
@@ -312,13 +312,10 @@
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 @@
l->rawexp += chartorune(&l->rune, l->rawexp);
if(*l->rawexp == 0)
l->done = 1;
- return;
}
static int
--
⑨