Skip to content
  • Mark Hills's avatar
    Prevent an empty match being seen as an error condition · 802fc32c
    Mark Hills authored
    Because grep returns non-zero error code if no matches were found,
    the script considers this an error condition.
    
    Switch to using "find -regex". I chose the posix-egrep syntax as this
    seems to be one of the standard formats which gives the most concise
    syntax for the regex itself.
    
    When this code was originally put in place there was some debate, and
    I wrote on the mailing list (29 Jan 2012):
    
    > I merged the changes just now, but I did it using grep instead of
    > iregex. And found that grep does not do a full-string match by default.
    >
    > I chose grep -E for a couple of minor reasons:
    >
    > * more widely available
    >
    > * matching in a separate thread to the 'find' could give marginally
    >   better performance
    >
    > Nothing seriously wrong with the other method though :-) Anyway, it's in
    > the beta now, so everyone can give it a test.
    
    In light of the information on error conditions, switch to the regex
    case. This breaks compatibility with non-GNU find implementations.
    802fc32c