<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/random, branch releng/13.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-08-23T17:43:32Z</updated>
<entry>
<title>Remove $FreeBSD$: one-line nroff pattern</title>
<updated>2023-08-23T17:43:32Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:32:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=24115b70d6d614ed7ac5cfc4f51fa9d6cfe8b1b2'/>
<id>urn:sha1:24115b70d6d614ed7ac5cfc4f51fa9d6cfe8b1b2</id>
<content type='text'>
Remove /^\.\\"\s*\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit b2c76c41be32)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-23T17:43:30Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:32:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=023fc80ee38a117fa65b2ccb2abf8bdc7dbd6fd9'/>
<id>urn:sha1:023fc80ee38a117fa65b2ccb2abf8bdc7dbd6fd9</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit d0b2dbfa0ecf)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-23T17:43:26Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3d497e17ebd33fe0f58d773e35ab994d750258d6'/>
<id>urn:sha1:3d497e17ebd33fe0f58d773e35ab994d750258d6</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in main:
(cherry picked from commit 1d386b48a555)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-23T17:43:21Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=17da660ad5b3b9cd90e164dd4dbb9beaa7203054'/>
<id>urn:sha1:17da660ad5b3b9cd90e164dd4dbb9beaa7203054</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit b3e7694832e8)
</content>
</entry>
<entry>
<title>random(6): Re-add undocumented support for floating point denominators</title>
<updated>2020-02-15T19:13:37Z</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2020-02-15T19:13:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=06257a71aa94cef6d4682a74d616cd427146ee92'/>
<id>urn:sha1:06257a71aa94cef6d4682a74d616cd427146ee92</id>
<content type='text'>
And document it in the manual page.

PR:		244139
Submitted by:	Keith White &lt;kwhite AT site.uottawa.ca&gt; (earlier version)
</content>
</entry>
<entry>
<title>random(6): Fix off-by-one</title>
<updated>2020-01-16T21:38:44Z</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2020-01-16T21:38:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=92f7ba208c63b09aa8b077761a6734ccde7efda7'/>
<id>urn:sha1:92f7ba208c63b09aa8b077761a6734ccde7efda7</id>
<content type='text'>
After r355693, random(6) -f sometimes fail to output all the lines of the
input file.  This is because the range from which random indices are chosen
is too big, so occasionally the random selection doesn't correspond to any
line and nothing gets printed.

(Ed. note: Mea culpa.  Working on r355693, I was confused by the sometime
use of 1-indexing, sometimes 0-indexing in randomize_fd().)

Submitted by:	Ryan Moeller &lt;ryan AT freqlabs.com&gt;
X-MFC-With:	r355693
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D23199
</content>
</entry>
<entry>
<title>random(6): produce random results</title>
<updated>2019-12-13T04:37:39Z</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2019-12-13T04:37:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c7b8411cc9e09b1a9879a0bca6a39b55de7247d8'/>
<id>urn:sha1:c7b8411cc9e09b1a9879a0bca6a39b55de7247d8</id>
<content type='text'>
This program is trash and there's no reason to keep it in base.  But as long as
we're shipping a silly program named 'random', let's actually make it random.
</content>
</entry>
<entry>
<title>DIRDEPS_BUILD: Update dependencies.</title>
<updated>2017-10-31T00:07:04Z</updated>
<author>
<name>Bryan Drewery</name>
<email>bdrewery@FreeBSD.org</email>
</author>
<published>2017-10-31T00:07:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ea825d02749f382c3f7e17f28247f20a48733eab'/>
<id>urn:sha1:ea825d02749f382c3f7e17f28247f20a48733eab</id>
<content type='text'>
Sponsored by:	Dell EMC Isilon
</content>
</entry>
<entry>
<title>Fix a (false positive?) Argument cannot be negative coverity defect.</title>
<updated>2016-06-08T02:14:05Z</updated>
<author>
<name>Don Lewis</name>
<email>truckman@FreeBSD.org</email>
</author>
<published>2016-06-08T02:14:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=290dadbd560601bc99dd1b6e721d3c2a3c0d329a'/>
<id>urn:sha1:290dadbd560601bc99dd1b6e721d3c2a3c0d329a</id>
<content type='text'>
Rather than guarding close(fd) with an fd &gt;= 0 test and setting fd
to -1 when it is closed to avoid a potential double-close, just
move the close() call after the conditional "goto make_token".  This
moves the close() call totally outside the loop to avoid the
possibility of calling it twice.  This should also prevent a Coverity
warning about checking fd for validity after it was previously passed
to read().

Reported by:	Coverity
CID:		1355335
MFC after:	1 week
X-MFC with:	r299484
</content>
</entry>
<entry>
<title>random(6): Fix double-close</title>
<updated>2016-05-11T22:04:28Z</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2016-05-11T22:04:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7bfdbca59613182ce7f7a5e1082fc1e76f612783'/>
<id>urn:sha1:7bfdbca59613182ce7f7a5e1082fc1e76f612783</id>
<content type='text'>
In the case where a file lacks a trailing newline, there is some "evil" code to
reverse goto the tokenizing code ("make_token") for the final token in the
file.  In this case, 'fd' is closed more than once.  Use a negative sentinel
value to guard close(2), preventing the double close.

Ideally, this code would be restructured to avoid this ugly construction.

Reported by:	Coverity
CID:		1006123
Sponsored by:	EMC / Isilon Storage Division
</content>
</entry>
</feed>
