URL: <http://savannah.gnu.org/bugs/?45505>
Summary: on invalid regexp detection, please tell users which RE is invalid (patch included) Project: findutils Submitted by: None Submitted on: Thu 09 Jul 2015 05:53:00 PM UTC Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Originator Name: Originator Email: jason.vas.d...@gmail.com Open/Closed: Open Discussion Lock: Any Release: None Fixed Release: None _______________________________________________________ Details: When using a find command with about 10 -iregexp regular expressions arguments, one of them contained a typo. I had to download and build the latest findutils distribution to find out which one . Please could you include something like the following patch (made against GIT master of 2015-07-09) to tell users which -regexp or -iregexp argument was invalid: --- find/parser.c~ 2015-07-09 18:44:19.787410855 +0100 +++ find/parser.c 2015-07-09 18:42:27.907153109 +0100 @@ -2115,7 +2115,7 @@ error_message = re_compile_pattern (rx, strlen (rx), re); if (error_message) - error (EXIT_FAILURE, 0, "%s", error_message); + error (EXIT_FAILURE, 0, "%s : %s", error_message, rx); our_pred->est_success_rate = estimate_pattern_match_rate (rx, 1); return true; } Really, the previous behavior was not very informative: /usr/local/bin/find: Invalid preceding regular expression Now it prints: /usr/local/bin/find: Invalid preceding regular expression : *[\#\~].* (I had left out the '.' prefix). _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Thu 09 Jul 2015 05:53:00 PM UTC Name: findutils.patch Size: 429B By: None patch against findutils latest GIT master ( c631c8e8e9850e9290072cc2b5fe6b6fb82050c9 ) <http://savannah.gnu.org/bugs/download.php?file_id=34404> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?45505> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/