bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #45505] on invalid regexp detection, please tell users which RE is


From: anonymous
Subject: [bug #45505] on invalid regexp detection, please tell users which RE is invalid (patch included)
Date: Thu, 09 Jul 2015 17:53:01 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0

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: address@hidden
             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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]