bugfindutils - Bugs: bug #15195, misleading error message

 
 

bug #15195: misleading error message

Submitter:  Eric Blake <ericb>
Submitted:  Mon 12 Dec 2005 02:01:22 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Eric Blake Open/Closed:  Closed
Release:  4.2.27 Fixed Release:  4.3.1
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 07 Aug 2006 09:42:01 AM UTC, comment #7: 

Fixed in 4.3.1, which has now been released

James Youngman <jay>
Group administrator
Thu 22 Dec 2005 05:12:58 AM UTC, comment #6: 

A couple more misleading messages, even with your latest patches:

currently:
$ find \( -true -a ! \)
find: invalid expression; you have too many ')'

nicer:
$ find \( -true -a ! \)
find: expected an expression after '!'

currently:
$ find \(
find: invalid expression; empty parentheses are not allowed.

nicer:
$ find \(
find: invalid expression; I was expecting to find a ')' somewhere but did not see one.

Eric Blake <ericb>
Group administrator
Wed 21 Dec 2005 01:09:59 PM UTC, comment #5: 

Minor nit:  NEWS now states that you get a more helpful error message from 'find . ( )', but most shells parse that wrong without quoting.  Maybe it is worth rewriting the NEWS entry as 'find . \( \)'.

Thanks for putting up with my nits, by the way!

Eric Blake <ericb>
Group administrator
Tue 20 Dec 2005 07:23:00 PM UTC, comment #4: 

I've now fixed these too, I think.

James Youngman <jay>
Group administrator
Tue 20 Dec 2005 01:40:38 PM UTC, comment #3: 

I agree you have fixed the empty parenthesis.  But 4.3.1-CVS still has a buggy error message when ! is not followed by an expression:

$ find !
find: invalid expression; you have too many ')'

Eric Blake <ericb>
Group administrator
Tue 20 Dec 2005 07:29:49 AM UTC, comment #2: 

This is now fixed in the development code (4.3.1+, not 4.2.x).  You now get:-

$ ./find -maxdepth 0 '(' -depth ')'
./find: warning: you have specified the -depth option after a non-option argument (, but options are not positional (-depth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.

.
$ ./find '(' ')'
./find: invalid expression; empty parentheses are not allowed.

James Youngman <jay>
Group administrator
Sun 18 Dec 2005 05:10:47 PM UTC, comment #1: 

Also, consider this:

Buggy:
$ find !
find: invalid expression; you have too many ')'

Expected:
$ find !
find: invalid expression; missing argument to '!'

Eric Blake <ericb>
Group administrator
Mon 12 Dec 2005 02:01:22 PM UTC, original submission:  

Quality of implementation bug:

$ find \( \)
find: invalid expression; you have too many ')'

Actually, I have a balanced set of \( \), the error message in this case would better be worded as something like:

find: invalid expression; expecting an expression between '(' and ')'

Or you could change the behavior as an extension to POSIX, and treat \( \) the same as \( -true \), although I wouldn't recommend that.

Eric Blake <ericb>
Group administrator

 

(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

Items that depend on this one: None found

 

CC list is empty

 

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 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-08-07 jay Open/ClosedOpen Closed
    Fixed ReleaseNone 4.3.1
2005-12-20 jay StatusNone Fixed
    Assigned toNone jay

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code