bugfindutils - Bugs: bug #18222, find -printf '%H %P' misbehaves...

 
 

bug #18222: find -printf '%H %P' misbehaves with multiple paths

Submitted by:  None
Submitted on:  Tue 07 Nov 2006 07:22:29 AM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 4.3.1
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 11 Nov 2006 04:00:43 AM UTC, comment #2:

Thank you for fixing this bug so quickly.

Anonymous
Wed 08 Nov 2006 10:17:20 AM UTC, comment #1:

The attached patch fixes this bug. The fix has been applied in CVS. It will be included in the next release of findutils 4.3.x (the 4.2.x release series was not affected).

James Youngman <jay>
Project AdministratorIn charge of this item.
Tue 07 Nov 2006 07:22:29 AM UTC, original submission:

When find is passed multiple paths, it misreports the printf fields %H and %P. Specifically, it splits the second path using the field length of the first path.

Example:
623 $ mkdir dir1
624 $ mkdir directory2
625 $ touch dir1/foo
626 $ touch directory2/bar
627 $ find dir1 directory2 -printf '%H %P\n'
dir1
dir1 foo
dire
dire ctory2/bar

oldfind gives the expected output:
628 $ oldfind dir1 directory2 -printf '%H %P\n'
dir1
dir1 foo
directory2
directory2 bar

My find is:
GNU find version 4.3.1
Features enabled: O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS CBO(level=0)

My uname -a is:
CYGWIN_NT-5.1 frederick 1.5.21(0.156/4/2) 2006-07-30 14:21 i686 Cygwin

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #11187:  sv-bug-18222.extra.patch added by jay (10KiB - text/x-patch - Additional patch indluding a test case)
file #11186:  sv-bug-18222.patch added by jay (1016B - text/x-patch - Patch fixing the problem)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Updated 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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 30 Nov 2006 11:56:23 PM UTCjayOpen/ClosedOpen=>Closed
    Wed 08 Nov 2006 10:37:57 AM UTCjayAttached File-=>Added sv-bug-18222.extra.patch, #11187
    Wed 08 Nov 2006 10:17:20 AM UTCjayStatusNone=>Fixed
      Assigned toNone=>jay
      Attached File-=>Added sv-bug-18222.patch, #11186
    Tue 07 Nov 2006 07:22:29 AM UTCNoneCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1