bugfindutils - Bugs: bug #36652, read_string() is wrongly...

 
 

bug #36652: read_string() is wrongly documented to check for logical eof.

Submitted by:  None
Submitted on:  Wed 13 Jun 2012 09:15:49 PM UTC  
 
Category: xargsSeverity: 2 - Minor
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Samuel BronsonOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.5.10
Fixed Release: 4.5.12

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Wed 13 Jun 2012 09:15:49 PM UTC, original submission:

The documentation comment for the read_string() function in xargs.c is:

/* Read a null-terminated string from the input and add it to the list of
arguments to pass to the command.
Return -1 if eof (either physical or logical) is reached,
otherwise the length of the string read (including the null). */

But, there does not appear to be any place where "logical" eof (input matching eof_str) could be checked for (nor is it really desirable that it be checked for in -0 mode, since the whole point of -0 is to allow any filename).

(It might also be a good idea to state in the documentation that -e/-E have no effect in -0 mode. Emacs' grep.el actually tries to use "xargs -0 -e", and if that doesn't work -- for example, with BSD xargs -- it falls back to "find -exec" ...)

And, nitpicking further, this function actually only returns -1 when it hits an EOF before it manages to read any characters into the buffer; otherwise, EOF is treated basically the same way as the seperator character (which, by the way, might not be NUL).

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

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)
  • -unavailable- added by None (Submitted 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
    Tue 24 Sep 2013 10:06:42 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.5.12
    Fri 29 Mar 2013 09:14:23 PM UTCjaySeverity3 - Normal=>2 - Minor
      StatusNone=>Fixed
      Assigned toNone=>jay
      ReleaseNone=>4.5.10

    Back to the top


    Powered by Savane 3.1-cleanup