diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-09-16 19:41:05 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-09-16 19:41:05 -0700 |
| commit | 3483cd75cb0a67d50bdcf9d03a15dc5af67a1986 (patch) | |
| tree | b5708ad1a0d242d420633368a4b211ecc68caf24 /vm.c | |
| parent | 1dd89c766a3d89fde1c84813c04061f5465c234c (diff) | |
Fixed upto for non-matches
Diffstat (limited to 'vm.c')
| -rw-r--r-- | vm.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -137,14 +137,16 @@ static match_t *_match(grammar_t *g, const char *str, vm_op_t *op, unsigned int match_t *p = _match(g, str, op->args.pat, flags, rec); if (p) { m->child = p; - str = p->end; - break; + m->end = p->end; + return m; } // This isn't in the for() structure because there needs to // be at least once chance to match the pattern, even if // we're at the end of the string already (e.g. "..$"). if (*str && (op->multiline || *str != '\n')) ++str; } + destroy_match(&m); + return NULL; } else if (op->multiline) { while (*str) ++str; } else { |
