Commit Graph

57 Commits

Author SHA1 Message Date
dsl
49f7d8a9b1 Add (unsigned char) cast to ctype functions 2004-11-05 21:30:31 +00:00
wiz
8dab296315 Some improvements from jmc@openbsd:
sort option descriptions, add argument to -m, mention strfile
and add some xrefs.
2004-09-09 22:01:08 +00:00
jsm
cb5fd8342e Remove uses of __P. 2004-01-27 20:30:28 +00:00
jsm
a3b9fbcc3a Include <sys/endian.h>. 2004-01-27 20:24:32 +00:00
jsm
23e0e03d00 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>.
2004-01-01 16:02:07 +00:00
jsm
cdce4b2c55 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>.
2004-01-01 16:01:25 +00:00
agc
e5aeb4ea46 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22269, verified by myself.
2003-08-07 09:36:50 +00:00
christos
9b564aed06 Fix bogon in compat re code. 2002-11-24 18:03:14 +00:00
wiz
c91d8d6b9b Lots of minor fixes resulting from reading these man pages in detail. 2002-09-26 18:31:58 +00:00
grant
6742cb1812 sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:36:17 +00:00
itojun
2f9ca37900 backout previous (arc4random), per request from sommerfeld 2002-07-01 20:55:30 +00:00
itojun
e9e21a77eb use arc4random 2002-07-01 14:51:52 +00:00
christos
4733c0cfff PR/15878: Ed Ravin: fortune all frees junk pointers. Fixed, free structure
members before freeing the structure itself.
2002-03-12 15:20:14 +00:00
soren
dc53bf3cba Sync getopt() / man page with actual getopt options. 2001-12-20 20:10:33 +00:00
wiz
a58e0c8a53 Undo indentation glitch in previous. 2001-10-28 19:52:53 +00:00
proff
20d62e03c5 improve random number seeding 2001-10-28 19:47:48 +00:00
atatat
60564f8ed0 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".
2001-08-15 17:25:42 +00:00
christos
ebe68eb4f9 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.
2001-06-04 21:21:42 +00:00
aymeric
37e6eb8fe5 Bail out when regex pattern is invalid if using regcomp or regcmp.
Remove trailing \n's also.

Addresses PR#13109
2001-06-04 20:56:56 +00:00
wiz
8a84240a6e Whitespace and/or punctuation fixes. 2001-04-02 22:47:29 +00:00
cgd
668a4dd967 convert to use getprogname() 2001-02-19 22:39:39 +00:00
christos
a2bee8edad fix nested extern and usage message 2001-02-05 00:29:44 +00:00
lukem
de3e6adaf6 use more standard %ll_ in favour of %q_ 2001-01-04 17:24:35 +00:00
mrg
f601feea40 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.
2000-10-31 13:27:56 +00:00
simonb
48a5c3efa9 Don't declare 'extern opt*' getopt variables. 2000-04-14 05:58:01 +00:00
drochner
85cbf55d16 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.
1999-11-09 15:06:30 +00:00
jsm
157087a683 Use macro NAMLEN rather than dirent->d_namlen, for easier portability. 1999-09-22 18:56:32 +00:00
jsm
20e3305006 Fix -Wsign-compare warnings. 1999-09-18 19:38:46 +00:00
jsm
2b25de3a90 Include <time.h> in various places in the games where time() or time_t
are used.
1999-09-09 17:30:17 +00:00
jsm
5fb18dd9da Use the symbolic names SEEK_SET' and O_RDONLY' where appropriate in
the games.
1999-09-08 21:57:16 +00:00
jsm
b03d4fa882 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).
1999-09-08 21:45:25 +00:00
jsm
092d313019 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.
1999-09-08 21:17:44 +00:00
simonb
87500c939d 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.
1999-08-21 07:02:46 +00:00
hubertf
1c9494f62b mark non-returning functions (PR#6144 by Joseph Myers <jsm28@cam.ac.uk>) 1998-09-13 15:27:25 +00:00
veego
04afeca685 Add braces to make the new egcs happy. 1998-08-30 09:19:36 +00:00
christos
2fed16a1b1 Add regexp support; remove -lcompat, use err*, warn* 1998-02-04 10:16:19 +00:00
lukem
43e8208cc2 use CPPFLAGS instead of CFLAGS, fix dependancies for parallel compile 1997-10-22 04:56:11 +00:00
mycroft
15de1c9fd2 Use S_IS*(), not S_IF*. 1997-10-19 17:54:18 +00:00
lukem
9f3003730a deprecate auto 1997-10-12 14:17:27 +00:00
lukem
3c70a27d72 WARNSify 1997-10-10 13:04:33 +00:00
mikel
b62af4ea5e don't xref obsolete regcmp(3) 1997-07-16 06:59:59 +00:00
mouse
412433b44c alternate -> alternative, per PR 2643 1997-03-08 13:26:20 +00:00
cgd
42fb1b9d4a merge with Lite, new RCS id conventions, etc. 1995-03-23 08:28:00 +00:00
cgd
c4c01d75b2 specify man pages the new way. 1994-12-22 09:31:26 +00:00
jtc
67a17b53b4 Use <dirent.h> instead of <sys/dir.h>. 1993-12-04 02:19:49 +00:00
jtc
8f83a67681 Link with -lcompat instead of -lgnuregex.
As soon as POSIX regular expressions are integrated into libc, -lgnuregex
will be going away.  Fortune use the old re_comp() & re_exec() regex
routines that are provided by -lcompat.
1993-11-11 01:01:21 +00:00
jtc
c63e7d82bc Drip -DNO_REGEX, Link with -lgnuregex. 1993-08-05 02:16:36 +00:00
jtc
61523efa72 Convert to -mandoc macros. 1993-08-05 02:15:58 +00:00
mycroft
52efca41cd Nuke remaining patchkit headers. 1993-08-02 18:17:24 +00:00
mycroft
53d05dab0d Makefile 1993-08-02 17:16:08 +00:00