aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--re.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ffc1e12f..a7482ec9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-10-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * re.c (make_regexp): When re_compile_pattern fails, use the
+ original text of the regexp in the error message. Thanks to Neil
+ R. Ormos <ormos-gnulists17@ormos.org> for the report.
+
2020-10-29 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (setup_frame): Handle the case of values from FUNCTAB.
diff --git a/re.c b/re.c
index fb28c563..d9191a1f 100644
--- a/re.c
+++ b/re.c
@@ -258,10 +258,10 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal)
refree(rp);
if (! canfatal) {
/* rerr already gettextized inside regex routines */
- error("%s: /%s/", rerr, buf);
+ error("%s: /%.*s/", rerr, len, s);
return NULL;
}
- fatal("invalid regexp: %s: /%s/", rerr, buf);
+ fatal("invalid regexp: %s: /%.*s/", rerr, len, s);
}
/* gack. this must be done *after* re_compile_pattern */