<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/usr.bin/xargs/strnsubst.c, branch master</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=master</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2017-12-27T03:23:01Z</updated>
<entry>
<title>userland: Fix several typos and minor errors</title>
<updated>2017-12-27T03:23:01Z</updated>
<author>
<name>Eitan Adler</name>
<email>eadler@FreeBSD.org</email>
</author>
<published>2017-12-27T03:23:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=dae3a64fb967bbff627efc2e8cdd127c6b93d902'/>
<id>urn:sha1:dae3a64fb967bbff627efc2e8cdd127c6b93d902</id>
<content type='text'>
- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by:	imp, benno
</content>
</entry>
<entry>
<title>Follow calloc convention in other code, this is functionally identical</title>
<updated>2013-01-05T00:23:58Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2013-01-05T00:23:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=df4110b6cf245e6b75f8172321cce04f90774186'/>
<id>urn:sha1:df4110b6cf245e6b75f8172321cce04f90774186</id>
<content type='text'>
to its previous form.
</content>
</entry>
<entry>
<title>Handle maxsize==0 in such a way that we don't modify the string.</title>
<updated>2005-12-30T23:22:50Z</updated>
<author>
<name>Juli Mallett</name>
<email>jmallett@FreeBSD.org</email>
</author>
<published>2005-12-30T23:22:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=38e62c6999de3411594145951fed88682a2334a9'/>
<id>urn:sha1:38e62c6999de3411594145951fed88682a2334a9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Modify behaviour of `xargs -I` in order to:</title>
<updated>2004-10-18T15:40:47Z</updated>
<author>
<name>Colin Percival</name>
<email>cperciva@FreeBSD.org</email>
</author>
<published>2004-10-18T15:40:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=5578bd8c991bd987dbf63ea87d5588e50fb410c3'/>
<id>urn:sha1:5578bd8c991bd987dbf63ea87d5588e50fb410c3</id>
<content type='text'>
1. Conform to IEEE Std 1003.1-2004, which state that "Constructed
arguments cannot grow larger than 255 bytes", and
2. Avoid a buffer overflow.

Unfortunately the standard doesn't indicate how xargs is supposed to
handle arguments which (with the appropriate substitutions) would grow
larger than 255 bytes; this solution handles those by making as many
substitutions as possible without overflowing the buffer.

OpenBSD's xargs resolves this in a different direction, by making
all the substitutions and then silently truncating the resulting string.

Since this change may break existing scripts which rely upon the buffer
overflow (255 bytes isn't really all that long...) it will not be MFCed.
</content>
</entry>
<entry>
<title>Check for results of repeated calls to strnsubst(), as well as for the</title>
<updated>2002-06-22T12:58:42Z</updated>
<author>
<name>Juli Mallett</name>
<email>jmallett@FreeBSD.org</email>
</author>
<published>2002-06-22T12:58:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=5058dcb497254b4188415d8b02e3f0eedd12b560'/>
<id>urn:sha1:5058dcb497254b4188415d8b02e3f0eedd12b560</id>
<content type='text'>
behaviour with NULL match string, as that has changed over time.
</content>
</entry>
<entry>
<title>Allow the input line to be NULL, and teach strnsubst() that NULL means to use</title>
<updated>2002-05-30T19:24:08Z</updated>
<author>
<name>Juli Mallett</name>
<email>jmallett@FreeBSD.org</email>
</author>
<published>2002-05-30T19:24:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=986d829b8fa29b653a40f382466c0b16ffdc63cd'/>
<id>urn:sha1:986d829b8fa29b653a40f382466c0b16ffdc63cd</id>
<content type='text'>
a nil-string.
</content>
</entry>
<entry>
<title>Fix a bug whereby we were getting ~0 and comparing it to maxsize, i.e. if</title>
<updated>2002-05-03T19:45:41Z</updated>
<author>
<name>Juli Mallett</name>
<email>jmallett@FreeBSD.org</email>
</author>
<published>2002-05-03T19:45:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=38dff9a4391c3c3537814acecc88b433fcd40156'/>
<id>urn:sha1:38dff9a4391c3c3537814acecc88b433fcd40156</id>
<content type='text'>
s1 was 0 length, and replstr was 0 length, etc., we would end up subtracting
one from zero and seeing if it was greater than the size_t (unsigned) var
maxsize...  This would cause us to return a string consisting of essentially
only match, which is not the right behaviour if we have 0 length inpline.
</content>
</entry>
<entry>
<title>*str is spelled 's1' inside the body of the code.</title>
<updated>2002-05-02T02:15:06Z</updated>
<author>
<name>Juli Mallett</name>
<email>jmallett@FreeBSD.org</email>
</author>
<published>2002-05-02T02:15:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=299ea75ab74646674c882badc6cb19f106752f4a'/>
<id>urn:sha1:299ea75ab74646674c882badc6cb19f106752f4a</id>
<content type='text'>
Make 'this' not a local variable, since it isn't necessary or complex enough
to warrant such.
</content>
</entry>
<entry>
<title>Rework some of the -I support so I can't find a way to make xargs(1) core or</title>
<updated>2002-05-02T02:06:03Z</updated>
<author>
<name>Juli Mallett</name>
<email>jmallett@FreeBSD.org</email>
</author>
<published>2002-05-02T02:06:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=0fa5e8dc420b528e314e3ea440a9bf3546955a84'/>
<id>urn:sha1:0fa5e8dc420b528e314e3ea440a9bf3546955a84</id>
<content type='text'>
corrupt memory.  Simplifies the code in one or two places, also removes some
code that looks like it was bogus or incomplete.

Update strnsubst to have one or two extra conditions which maybe would make
it more efficient, or at least more versatile.  This is likely a no-op.
</content>
</entry>
<entry>
<title>After 3 months...</title>
<updated>2002-04-19T23:28:54Z</updated>
<author>
<name>Juli Mallett</name>
<email>jmallett@FreeBSD.org</email>
</author>
<published>2002-04-19T23:28:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=fc17b349c80e282eca14a7e065caa67f07525a80'/>
<id>urn:sha1:fc17b349c80e282eca14a7e065caa67f07525a80</id>
<content type='text'>
Merge xargs(1) with that of xMach.

Bring in xargs(1) changes to add -L and -I as per the Single Unix Specification
version 3.  Proper exit status numbers are implemented, and the manual page has
been updated to reflect reality.

The code has been ANSIfied, and a new file has been added to xargs(1) to do the
substring substitution as SUSv3 requires.

Traditional behaviour should not be affected, use of -J should be deprecated
in favor of the more portable -I (though -J has been left, for now).

Submitted by:	me, tjr (the exit status stuff)
Obtained from:	xMach
</content>
</entry>
</feed>
