diff --git a/compilecode.c b/compilecode.c index 91f6488..7a53256 100644 --- a/compilecode.c +++ b/compilecode.c @@ -142,10 +142,12 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode) case '^': EMIT(PC++, Bol); prog->len++; + term = PC; break; case '$': EMIT(PC++, Eol); prog->len++; + term = PC; break; } } diff --git a/run-tests b/run-tests index 12fa1db..2f67486 100755 --- a/run-tests +++ b/run-tests @@ -68,6 +68,8 @@ test_suite = [ ("search", "|+", ""), ("search", "|*", ""), ("search", "|?", ""), + ("search", "^*", ""), + ("search", "$*", ""), ] import re