bugfindutils - Bugs: bug #20688, 'find / -nowarn -maxdepth 0 -name...

 
 

bug #20688: 'find / -nowarn -maxdepth 0 -name /' still warns

Submitted by:  Eric Blake <ericb>
Submitted on:  Sat 04 Aug 2007 09:29:17 PM UTC  
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Fixed
Privacy:  Public Assigned to:  Eric Blake <ericb>
Originator Name:  Eric Blake Open/Closed:  Closed
Release:  4.2.21 Fixed Release:  4.3.9

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sun 05 Aug 2007 03:29:41 AM UTC, comment #2: 

In the process of fixing bug #20662, I ended up patching this first in order to add a test to the testsuite without tripping over the warning.

My patch stuck with the existing simpler approach of warning if / appears anywhere in the -name argument, rather than filtering on the special cases of '-name /' or '-name //', since those are rare in practice.

Eric Blake <ericb>
Project AdministratorIn charge of this item.
Sat 04 Aug 2007 09:36:29 PM UTC, comment #1: 

Agree the warning should be suppressible.  When the warning is not suppressed it should not be issued anyway for "/", being the one case where there will be a match.

James Youngman <jay>
Project Administrator
Sat 04 Aug 2007 09:29:17 PM UTC, original submission:  

The warning issued by -name when the pattern includes '/' is not mentioned in find.texi, either as a suppressable warning or as a severe warning.  I think it should be suppressable, because as the following command line shows, it is only a warning and not a hard fact that -name / usually results in no matches:

$ find / -nowarn -maxdepth 0 -name /
find: warning: Unix filenames usually don't contain slashes (though pathnames do).  That means that '-name `/'' will probably evaluate to false all the time on this system.  You might find the '-wholename' test more useful, or perhaps '-samefile'.  Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ `/''.
/

Either way, whether we change parser.c to let -nowarn suppress this warning or not, we also need to document this warning in find.texi.

Eric Blake <ericb>
Project AdministratorIn charge of this item.

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

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

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

    Only logged-in users can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-11-11 jay Open/ClosedOpen => Closed
        Fixed ReleaseNone => 4.3.9
    2007-09-04 ericb Dependencies- => bugs #20970 is dependent
    2007-08-05 ericb StatusIn Progress => Fixed
    2007-08-05 ericb StatusNone => In Progress
        Assigned toNone => ericb

    Back to the top


    Powered by Savane 3.6