summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Vas Dias <jason.vas.dias@gmail.com>2015-10-26 16:48:20 +0000
committerJames Youngman <jay@gnu.org>2015-10-26 16:51:49 +0000
commitf4dd5bdbd8af5fc5de2081a2dbf8aed457994c24 (patch)
tree64d52ff4a3a9cfe2cdd86c28ffe6b8059e87f13a
parentc46bfb3cacb559de049425c05dd5cbcd52535441 (diff)
downloadfindutils-f4dd5bdbd8af5fc5de2081a2dbf8aed457994c24.tar.gz
Fix bug #45505: improve error message given for invalid regular expression.
* find/parser.c (insert_regex): improve error message given for invalid regular expression. * NEWS: mention this bugfix. Copyright-paperwork-exempt: yes
-rw-r--r--NEWS3
-rw-r--r--find/parser.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 9b5a1c55..6fc71d64 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
** Bug Fixes
#45585: unclear description of -newerXY in manual page.
+#45505: give a more explicit error message when the argument to -regex
+ is not a valid regular expression.
+
#45090: oldfind incorrectly omits test/..test (or any file whose name
begins with ..).
diff --git a/find/parser.c b/find/parser.c
index 0d19ba3c..b6d966aa 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -2115,7 +2115,8 @@ insert_regex (char **argv,
error_message = re_compile_pattern (rx, strlen (rx), re);
if (error_message)
- error (EXIT_FAILURE, 0, "%s", error_message);
+ error (EXIT_FAILURE, 0, "failed to compile regular expression '%s': %s",
+ rx, error_message);
our_pred->est_success_rate = estimate_pattern_match_rate (rx, 1);
return true;
}