bugfindutils - Bugs: bug #45505, on invalid regexp detection,...

 
 

bug #45505: on invalid regexp detection, please tell users which RE is invalid (patch included)

Submitter:  None
Submitted:  Thu 09 Jul 2015 05:53:00 PM UTC
   
 
Category:  find Severity:  2 - Minor
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.5.13
Fixed Release:  4.5.15
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 26 Oct 2015 04:58:24 PM UTC, comment #1: 
James Youngman <jay>
Group administrator
Thu 09 Jul 2015 05:53:00 PM UTC, original submission:  

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).


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #34404:  findutils.patch added by None (429B - text/x-diff - patch against findutils latest GIT master ( c631c8e8e9850e9290072cc2b5fe6b6fb82050c9 ))

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-12-18 jay Open/ClosedOpen Closed
        Fixed ReleaseNone 4.5.15
    2015-10-26 jay CategoryNone find
        Severity3 - Normal 2 - Minor
        StatusNone Fixed
        Assigned toNone jay
        ReleaseNone 4.5.13
    2015-07-09 None Attached File- Added findutils.patch, #34404

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code