libregexp: fix lexer so it doesnt move past the string when it gets a \ escape

front
cinap_lenrek 2017-07-31 06:56:22 +02:00
parent 6e65596827
commit b4c1cf2ea1
1 changed files with 2 additions and 6 deletions

View File

@ -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