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

 
 

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

Submitter:  None
Submitted:  Wed 13 Jun 2012 09:15:49 PM UTC
   
 
Category:  xargs Severity:  2 - Minor
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Samuel Bronson Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.5.10
Fixed Release:  4.5.12
* Mandatory Fields

Add a New Comment Rich Markup
   

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 Files:
   
   
Comment:
   

No files currently attached

 

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)
  • -email is unavailable- added by None (Submitted 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
    2013-09-24 jay Open/ClosedOpen Closed
        Fixed ReleaseNone 4.5.12
    2013-03-29 jay Severity3 - Normal 2 - Minor
        StatusNone Fixed
        Assigned toNone jay
        ReleaseNone 4.5.10

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code