From de0fec8fcb2e09500b4665b07fdad6a2902d9c87 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 26 Jan 2021 17:54:23 -0800 Subject: Removed check() and replaced with err()/errx() --- pattern.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pattern.c') diff --git a/pattern.c b/pattern.c index ff9841f..5ecd774 100644 --- a/pattern.c +++ b/pattern.c @@ -3,6 +3,7 @@ // #include +#include #include #include #include @@ -180,7 +181,8 @@ static pat_t *bp_simplepattern(file_t *f, const char *str) pat_t *pat = _bp_simplepattern(f, str); if (pat == NULL) return pat; - check(pat->end != NULL, "pat->end is uninitialized!"); + if (pat->end == NULL) + errx(EXIT_FAILURE, "pat->end is uninitialized!"); // Expand postfix operators (if any) str = after_spaces(pat->end); @@ -503,7 +505,8 @@ pat_t *bp_stringpattern(file_t *f, const char *str) // etc.) or \\, then check for an interpolated value: if (e != str[1] || e == '\\' || e == 'N') { interp = bp_simplepattern(f, str); - check(interp, "Failed to match pattern %.*s", 2, str); + if (!interp) + errx(EXIT_FAILURE, "Failed to match pattern %.*s", 2, str); break; } else { interp = bp_simplepattern(f, str + 1); -- cgit v1.2.3