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


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

Submitter:  None
Submitted:  Tue 07 Nov 2006 07:22:29 AM UTC
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.3.1
Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

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

Thank you for fixing this bug so quickly.

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>
Group administrator
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.

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

oldfind gives the expected output:
628 $ oldfind dir1 directory2 -printf '%H %P\n'
dir1 foo
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



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

Attach Files:

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
  • -email is unavailable- added by jay (Updated the item)

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

    Date Changed by Updated Field Previous Value => Replaced by
    2006-11-30 jay Open/ClosedOpen Closed
    2006-11-08 jay Attached File- Added sv-bug-18222.extra.patch, #11187
    2006-11-08 jay StatusNone Fixed
        Assigned toNone jay
        Attached File- Added sv-bug-18222.patch, #11186
    2006-11-07 None Carbon-Copy- Added -unavailable-

    Back to the top

    Powered by Savane 3.13-1277.
    Corresponding source code