Home | History | Annotate | Download | only in fortune
History log of /src/games/fortune/fortune/fortune.c
RevisionDateAuthorComments
 1.65  21-Jul-2020  nia fortune: arc4random_uniform for better uniform values than random() % ...
 1.64  19-Jun-2012  dholland WARNS=5, and make WARNS=5 the default for src/games.
 1.63  17-Jan-2010  wiz branches: 1.63.6;
Close two file descriptors after using them. Found by cppcheck.
 1.62  27-Aug-2009  dholland Instead of trying to cons up a regexp that ignores case, use REG_ICASE.
This makes fortune -im work; it's been broken since whenever.
 1.61  27-Aug-2009  dholland Tidy up regexp handling further.
 1.60  27-Aug-2009  dholland Prune conditional compilation for using obsolete regexp libraries.
 1.59  27-Aug-2009  dholland Whitespace.
 1.58  27-Aug-2009  dholland Prevent nasal demons in a case I spotted while preparing the previous.
 1.57  27-Aug-2009  dholland ANSIfy function definitions.
 1.56  27-Aug-2009  dholland Sprinkle some size_t in places where it's better than int.
(Reduces casts.)
 1.55  27-Aug-2009  dholland remove more unnecessary casts
 1.54  27-Aug-2009  dholland Use correct type for malloc sizes (size_t, not unsigned)
 1.53  27-Aug-2009  dholland remove unnecessary casts
 1.52  12-Aug-2009  dholland sprinkle static
 1.51  20-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
 1.50  15-Dec-2007  perry branches: 1.50.6;
convert __attribute__s to applicable cdefs.h macros
 1.49  13-May-2006  christos branches: 1.49.10;
Coverity CID 3269: Fix memory leak.
 1.48  21-Mar-2006  christos Coverity CID 2735: Remove dead code.
 1.47  18-Mar-2006  christos Coverity CID 827: Prevent NULL pointer deref.
 1.46  18-Mar-2006  christos Coverity CID 1699: Fix memory leaks.
 1.45  18-Mar-2006  christos Coverity CID 2544: Fix memory leak.
 1.44  05-Nov-2004  dsl Add (unsigned char) cast to ctype functions
 1.43  27-Jan-2004  jsm Remove uses of __P.
 1.42  27-Jan-2004  jsm Include <sys/endian.h>.
 1.41  01-Jan-2004  jsm Return proper fortune length from fortlen for fortune files without
STR_RANDOM or STR_ORDERED rather than comparing it to SLEN. Bug
reported by Simon Williams <simon@no-dns-yet.org.uk>.
 1.40  01-Jan-2004  jsm Show residual probability rather than non-residual in "No place to put
residual probability" error message. Distribute residual probability
correctly rather than all to one file. Patch from Mike Castle
<dalgoda@ix.netcom.com>.
 1.39  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.
 1.38  24-Nov-2002  christos Fix bogon in compat re code.
 1.37  20-Jul-2002  grant sweep of errx/warnx, remove unnecessary trailing \n
 1.36  01-Jul-2002  itojun backout previous (arc4random), per request from sommerfeld
 1.35  01-Jul-2002  itojun use arc4random
 1.34  12-Mar-2002  christos PR/15878: Ed Ravin: fortune all frees junk pointers. Fixed, free structure
members before freeing the structure itself.
 1.33  20-Dec-2001  soren Sync getopt() / man page with actual getopt options.
 1.32  28-Oct-2001  wiz Undo indentation glitch in previous.
 1.31  28-Oct-2001  proff improve random number seeding
 1.30  15-Aug-2001  atatat Change -a to mean all files, as opposed to just a few more files.

Modify the regex handling so that we can match fortunes in rot13'ed
databases (rot13 the pattern and maintain a second compiled pattern)
and rot13 the rot13'ed fortune before output.

Move the rot13 code to a function since it's now used in three places
instead of just one.

Initialize posfile in one place since it appears to get used without
being initialized when using debugging.

Make a *slight* improvement to the random seeding by squaring the pid
and then xor'ing against the current time, since just xor'ing the time
with the pid will not change if they both advance by one from "odd" to
"even".
 1.29  04-Jun-2001  christos Overhaul error handling and reporting for regular expressions.
Provide a RE_OK() macro that tests if the current compiled pattern
works and a RE_ERROR() macro that prints what went wrong as well
as the particular RE implementation can handle.
 1.28  04-Jun-2001  aymeric Bail out when regex pattern is invalid if using regcomp or regcmp.
Remove trailing \n's also.

Addresses PR#13109
 1.27  19-Feb-2001  cgd convert to use getprogname()
 1.26  05-Feb-2001  christos fix nested extern and usage message
 1.25  04-Jan-2001  lukem use more standard %ll_ in favour of %q_
 1.24  31-Oct-2000  mrg fix a bug in the call to srandom(): xor time() with getpid(), don't add them!

now fortune(6) run in an unending loop does not appear to show the same
fortunes over and over and over.
 1.23  14-Apr-2000  simonb Don't declare 'extern opt*' getopt variables.
 1.22  09-Nov-1999  drochner Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
 1.21  22-Sep-1999  jsm branches: 1.21.4;
Use macro NAMLEN rather than dirent->d_namlen, for easier portability.
 1.20  18-Sep-1999  jsm Fix -Wsign-compare warnings.
 1.19  09-Sep-1999  jsm Include <time.h> in various places in the games where time() or time_t
are used.
 1.18  08-Sep-1999  jsm Use the symbolic names `SEEK_SET' and `O_RDONLY' where appropriate in
the games.
 1.17  08-Sep-1999  jsm Add `__noreturn__' and `__unused__' attributes where appropriate to
the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Most noreturn attributes were previously added in bin/6144, with some
others that were missed then in bin/8082. Previous `unused'
attributes were covered in bin/6557, bin/8058 and other PRs (all these
PRs have already been handled and closed).
 1.16  08-Sep-1999  jsm Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.
 1.15  21-Aug-1999  simonb Use new endian-specific conversion macros - 64-bit off_t's are now
the stored the same regardess of the byte order of the generating
host.

Note in the strfile(8) man page that all fields are big-endian, not
in network byte order.
 1.14  13-Sep-1998  hubertf mark non-returning functions (PR#6144 by Joseph Myers <jsm28@cam.ac.uk>)
 1.13  30-Aug-1998  veego Add braces to make the new egcs happy.
 1.12  04-Feb-1998  christos Add regexp support; remove -lcompat, use err*, warn*
 1.11  19-Oct-1997  mycroft Use S_IS*(), not S_IF*.
 1.10  12-Oct-1997  lukem deprecate auto
 1.9  10-Oct-1997  lukem WARNSify
 1.8  23-Mar-1995  cgd merge with Lite, new RCS id conventions, etc.
 1.7  04-Dec-1993  jtc Use <dirent.h> instead of <sys/dir.h>.
 1.6  02-Aug-1993  mycroft Nuke remaining patchkit headers.
 1.5  01-Aug-1993  mycroft Add RCS identifiers.
 1.4  20-Apr-1993  mycroft Fix compilation error I introduced.
 1.3  18-Apr-1993  mycroft Cleanup for GCC 2.
 1.2  21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  21-Mar-1995  cgd from Lite
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.21.4.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.49.10.1  09-Jan-2008  matt sync with HEAD
 1.50.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.63.6.1  30-Oct-2012  yamt sync with head

RSS XML Feed