aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'text.c')
-rw-r--r--text.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/text.c b/text.c
index 004de22..9350819 100644
--- a/text.c
+++ b/text.c
@@ -1177,7 +1177,10 @@ Regex *text_regex_new(void) {
int text_regex_compile(Regex *regex, const char *string, int cflags) {
regex->string = string;
- return regcomp(&regex->regex, string, cflags);
+ int r = regcomp(&regex->regex, string, cflags);
+ if (r)
+ regcomp(&regex->regex, "\0\0", 0);
+ return r;
}
void text_regex_free(Regex *r) {