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

 
 

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

Submitted by:  None
Submitted on:  Thu 09 Jul 2015 05:53:00 PM UTC  
 
Category: findSeverity: 2 - Minor
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 4.5.13
Fixed Release: 4.5.15

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 26 Oct 2015 04:58:24 PM UTC, comment #1:

I've applied your patch in a slightly modified form:
http://git.savannah.gnu.org/cgit/findutils.git/commit/?id=f4dd5bdbd8af5fc5de2081a2dbf8aed457994c24

James Youngman <jay>
Project AdministratorIn charge of this item.
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 File(s):
   
   
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
  • -unavailable- added by jay (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 18 Dec 2015 02:55:40 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.5.15
    Mon 26 Oct 2015 04:58:24 PM UTCjayCategoryNone=>find
      Severity3 - Normal=>2 - Minor
      StatusNone=>Fixed
      Assigned toNone=>jay
      ReleaseNone=>4.5.13
    Thu 09 Jul 2015 05:53:00 PM UTCNoneAttached File-=>Added findutils.patch, #34404

    Back to the top


    Powered by Savane 3.1-cleanup1