History log of /freebsd-9.3-release/games/fortune/fortune/fortune.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 249828 24-Apr-2013 eadler

Merge unmerged commits to fortune(1)


# 243197 17-Nov-2012 dim

MFC r243036:

In games/fortune/fortune/fortune.c, make 'Debug' the correct type (it is
*not* a boolean).


# 242687 06-Nov-2012 eadler

MFC r242577:
Make OK_TO_WRITE_TO_DISK an envrionment variable instead
of a compile time option.

While here, don't differ based on the existence of LOCK_EX
which doesn't seem to have ever made a difference on FreeBSD.

Approved by: cperciva (implicit)


# 242686 06-Nov-2012 eadler

MFC r242576:
Prefer the use of stdbool to custom defines.

Approved by: cperciva (implicit)


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 204178 21-Feb-2010 uqs

Prefer exit(0) from main over return(0).

Although not explicitly mentioned in style(9), it allows for easier
grepping of exit points. This reverts part of r203926.

Requested by: des
Approved by: philip (mentor)


# 203926 15-Feb-2010 uqs

fortune(6) switch to 3-clause BSDL; style(9)

This reduces the diff to other *BSD and makes it possible to actually
see the code differences.

Approved by: ed (Co-mentor)


# 203922 15-Feb-2010 uqs

fortune(6) make WARNS=6 clean

Fixes taken mostly from DragonflyBSD.

Approved by: ed (Co-mentor)


# 181385 07-Aug-2008 ache

Use arc4random_uniform(3)

Obtained from: OpenBSD


# 173401 06-Nov-2007 edwin

After discussions with grog@ (mentor):

- When none of the directories in FORTUNE_PATH exist, abort instead
of using the default FORTDIR.
- Little stylify changes.
- Add documentation about the FORTUNE_PATH variable.

MFC after: 1 week


# 173396 06-Nov-2007 edwin

games/fortune: add FORTUNE_PATH env var, so ports of fortunes can work sanely

This patch adds an environment variable FORTUNE_PATH, which
works like PATH for fortune files.

PR: bin/36867
Submitted by: Alan Eldridge <ports@geeksrus.net>

[patch] fortune -e implementation bug

Fix the behaviour of "-e file1 file2" to equally pick them
instead of only picking the first one.

PR: bin/70182
Submitted by: Martin Kulas <coolaz@web.de>

MFC after: 1 week
Approved by: grog (mentor)


# 148349 23-Jul-2005 ache

My change, namely srandomdev() addition, was backed out even without
discussing with me, and I obviously disagree seeing that afterwards
(srandomdev() back out not fix any thing, it can only mask the problem).

So, back out the back out and return srandomdev().

People who have problems with repeated quotes should use -D fortune
option for debugging to see is the problem in (1) /dev/random initialization
or in (2) fortune code itself.

I will be glad to help, but I can't reproduce repeated quote situation
on my machine.

In either case found, (1) or (2) should be fixed instead of removing
srandomdev().


# 148325 22-Jul-2005 grog

Use a random number to seed the random number generator. Goodby, Rush
Limbaugh.

This should have already worked properly if random(4) has been
initialized correctly, but it seems that this is frequently not the
case. Instead, use the microsecond part of the current time as the
seed.


# 142022 17-Feb-2005 ru

Make the on-disk format of .dat files produced by strfile(8)
architecture independent. Besides the fixed-width types in
the header, the offsets are now stored as 64-bit off_t (also
in big endian format).

Tested on: i386, amd64, sparc64, ia64


# 141581 09-Feb-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


# 130851 21-Jun-2004 phk

Discontinue use of old libcompat regexp routines.


# 123905 27-Dec-2003 ceri

Stop "fortune -l" from looping forever.

PR: bin/58730
Submitted by: pak <pak@cns.utoronto.ca>


# 114725 05-May-2003 obrien

Make the __FBSDID usage consistent
and protect copyright[] from Gcc 3.3's whining.


# 93063 23-Mar-2002 imp

o remove __P


# 90868 18-Feb-2002 mike

o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
complexities associated with having MD (asm and inline) versions, and
having to prevent exposure of these functions in other headers that
happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on: alpha, i386
Reviewed by: bde, jake, tmm


# 81586 13-Aug-2001 ru

Removed duplicate VCS ID tags, as per style(9).


# 78794 26-Jun-2001 dd

Correct usage.


# 53920 30-Nov-1999 billf

copyright/sccsid/rcsid cleanup.


# 53210 16-Nov-1999 billf

Sync our register usage with NetBSD's (non-)usage.


# 51863 02-Oct-1999 dcs

Ignore comment lines in files marked as having them.


# 49892 16-Aug-1999 tg

Fix core dump with `fortune -f'.


# 49040 23-Jul-1999 billf

(1) Avoid ambigous if/else

PR: bin/12768
Submitted By: Stephen J. Roznowski <sjr@home.net>

(2) Follow KNF


# 47872 11-Jun-1999 hoek

Compile when NO_REGEX is defined.

Submitted by: Geordy Kitchen <gkitchen@cs.ubc.ca> (gnu/12117)


# 47440 23-May-1999 imp

Getopt(3) returns -1, not EOF.


# 44599 09-Mar-1999 dcs

Document -D option. Give a more helpful error message for some cases.

PR: bin/10152
Obtained from: Matthew D. Fuller <fullermd@futuresouth.com>


# 26627 13-Jun-1997 ache

Remove srandomdev fallback code


# 24212 24-Mar-1997 ache

Use srandomdev() to initialize generator


# 23698 11-Mar-1997 ache

Fix srandom arg type according to Lite2


# 23533 08-Mar-1997 ache

Make /dev/urandom fd static, or it pick up random descriptor
(stack garbadge) and read from it

Should go into 2.2


# 23067 23-Feb-1997 mpp

Allow fortune to use /dev/urandom if available to obtain its random
numbers. If /dev/urandom is unavailable, it will fall back to
using the random() function.

I did this because I'm sick of seeing the same handful of fortunes
over and over, and I've seen the exact same fortune one too many times
when starting up two login shells at the same time.

2.2 safe.


# 18485 24-Sep-1996 bde

Eliminated includes of the "temporary" backwards compatibility header
<sys/dir.h> in applications. Maintained existing (inadequate) ifdefs
for dir.h vs dirent.h in libdialog, amd and rarpd, but didn't add any
new ones.


# 17537 12-Aug-1996 ache

Pick collate info too


# 15957 28-May-1996 ache

Fix -f mode
Fix freeing of wrong pointer


# 15944 27-May-1996 ache

Localize it.
off_t -> long.
Install strfile & unstr
-Wall cleanup
Fix matching bug with offensive database


# 2491 04-Sep-1994 jkh

This commit was generated by cvs2svn to compensate for changes in r2490,
which included commits to RCS files with non-trunk default branches.


# 2490 04-Sep-1994 jkh

Bring in the 4.4 Lite games directory, modulo man page changes and segregation
of the x11 based games. I'm not going to tag the originals with bsd_44_lite
and do this in two stages since it's just not worth it for this collection,
and I've got directory renames to deal with that way. Bleah.
Submitted by: jkh