Re: patch for review: xargs standards compliance

"Tim J. Robbins" <[email protected]>
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
On Fri, Mar 22, 2002 at 03:52:31AM +0000, J. Mallett wrote:

> On Sat, Mar 16, 2002 at 10:14:35AM +0000, J. Mallett wrote:

> > http://people.freebsd.org/~jmallett/xargs.patch3
> 
> I take it nobody objects to this version of my patch then?

I don't like the wording here:

+ .It Fl I Ar replstr
+ If this option is specified up to 5 occurences of
+ .Ar replstr
+ may be replaced in the arguments to
+ .Ar utility
+ with one line of standard input.
+ .Ar Utility
+ is executed for every line of input in this mode.
+ In this mode
+ .Fl x
+ is implied.

Wouldn't this be better?

.It Fl I Ar replstr
Execute
.Ar utility
for each input line, replacing up to 5 occurrences of
.Ar replstr
in the arguments with the line read.
Implies
.Fl x .

(or similar; mdoc-ing hasn't been checked).

And while not really a bug, there probably should be const qualifiers
on `match' and `replstr' in strnsubst():
size_t strnsubst(char **str, char *match, char *replstr, size_t n)

+ 		if (this == NULL)
+ 			goto done;

This goto could be changed to a break, simplifying it a bit.


Tim

To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-audit" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.