aboutsummaryrefslogtreecommitdiff
path: root/bpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'bpeg.c')
-rw-r--r--bpeg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bpeg.c b/bpeg.c
index e2e5286..8575ee3 100644
--- a/bpeg.c
+++ b/bpeg.c
@@ -52,6 +52,7 @@ static char *getflag(const char *flag, char *argv[], int *i)
static int run_match(grammar_t *g, const char *filename, vm_op_t *pattern, unsigned int flags)
{
file_t *f = load_file(filename);
+ check(f, "Could not open file: %s", filename);
match_t *m = match(g, f, f->contents, pattern, flags);
if (m != NULL && m->end > m->start + 1) {
print_match(f, m);