diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-11-13 09:46:08 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-11-13 09:46:08 -0800 |
commit | 1b6568b322ea4817ae7e0afe71b95718333c6afa (patch) | |
tree | 428bbf13c0bdda2f2cd5687c13137fa90cabdf88 /match.c | |
parent | 7400f0f0e7821bc3f7b6cc6ab4af4438d8949209 (diff) | |
download | txr-1b6568b322ea4817ae7e0afe71b95718333c6afa.tar.gz txr-1b6568b322ea4817ae7e0afe71b95718333c6afa.tar.bz2 txr-1b6568b322ea4817ae7e0afe71b95718333c6afa.zip |
Bug #34813
* match.c (v_freeform): Fail if the data is null,
to avoid a false positive match as an empty line, followed by the type
error of incrementing a nonexistent data line number.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1670,6 +1670,9 @@ static val v_freeform(match_files_ctx *c) if ((c->spec = rest(c->spec)) == nil) { sem_error(first_spec, lit("freeform must be followed by a query line"), nao); + } else if (!c->data) { + debuglf(specline, lit("freeform match failure: no data"), nao); + return nil; } else { val limit = or2(if2(nump(first(vals)), first(vals)), if2(nump(second(vals)), second(vals))); |