perry [Thu, 30 Jun 2005 13:30:33 +0000 (13:30 +0000)]
ching(6) -- The Book of Changes, not seen in BSD since 4.4BSD.
The C code is a complete rewrite done by Guy Harris for 4.4BSD and is
not the original from v7 at all. Unfortunately, the data file itself,
without which the rest isn't useful, was not freed until Caldera
released all of 32v a few years ago, so it was not in 4.4lite.
The data file, the ching nroff macros, and the driver script are under
Caldera or Caldera+Berkeley copyright.
I've partially redone the driver script from 4.4 (there was no point
in using a temporary file for the hexagram), which was already
partially redone from 32v. (As an aside, it is nutty that the script
needs a copyright so many times longer than the code.)
I've renamed "cno" to "castching", "phx" to "printching", (the
traditional names were opaque), and put them in /usr/libexec/ching
instead of the v7 /usr/games/ching.d. The data file and nroff macros
are in /usr/share/games/ching
symka [Thu, 30 Jun 2005 06:08:56 +0000 (06:08 +0000)]
Fixed error on a nonexistent mail spool file, when countmail can't find it\n\nCloses PR misc/29526\n\n\(Code submitted in PR misc/29526 by Andreas Eder)
rillig [Mon, 27 Jun 2005 20:32:07 +0000 (20:32 +0000)]
Changed the type of data_table to be unsigned char[] instead of char[],
because it is initialized with values >= SCHAR_MAX. Also removed two
unnecessary bit mask operations. These changes do not affect the actual
behavior. Also replaced an "#ifdef notdef" with "#if 0". All these
changes are mainly for reducing lint(1) warnings.
hubertf [Wed, 22 Jun 2005 20:11:03 +0000 (20:11 +0000)]
* Change program logic to not nest needlessly
* Search all acronyms databases, and don't force the user to
know in which category to look (-t is gone)
* If an acronym is not found in the database or by whatis(1),
also check pkg_info(1). Per PR bin/30539 by Geert Hendrickx
(geert.hendrickx@ua.ac.be)
Fixed wrong use of datatypes. In wait_for(), a char was used together
with getchar(), in readchar(), a char was used to read input, which in
getuchar() is used as an argument to islower() and toupper(). Also removed
a condition which terminated the process if the user typed in character
255. Approved by christos.
jwise [Mon, 21 Mar 2005 18:45:18 +0000 (18:45 +0000)]
Fix a long-standing bug in wump(6) whereby hitting ^d to exit would first
print ``Care to play another game? (y-n)'' (but then exit anyway without
waiting for an answer).
jsm [Tue, 15 Feb 2005 12:58:21 +0000 (12:58 +0000)]
Don't presume phantasia's internal bool (char) is the same as that in
curses.h: define phbool and use it where necessary to avoid declaring
functions with one bool and defining them with the other.
jmc [Thu, 9 Dec 2004 05:15:59 +0000 (05:15 +0000)]
Redo how void gets init'd.
setup now just creates an empty file. When main starts and loads it in,
it stats and if zero size init's a new location and saves it back out.
Now games.tgz can be shared among MACHINE_ARCH's
christos [Sun, 2 May 2004 21:31:23 +0000 (21:31 +0000)]
- don't catch STOP, TSTP, QUIT; the first you cannot catch and the other two
you should not.
- don't accept delay == 1000, because it turns to 0 and fix the number parsing
- misc KNF cleanups.
he [Sun, 11 Apr 2004 13:35:06 +0000 (13:35 +0000)]
Undef bool before including <curses.h>, since it tries to typedef
bool. Otherwise we get (at least on gcc 2.95.3) an empty declaration
warning from "typedef char char;" due to the #define of bool in
phantstruct.h.
If the current player has no cards, skip to the other player.
While we're here, make this compile with -DDEBUG.
Fixes PR bin/12530 from Thomas Klausner.
jsm [Fri, 13 Feb 2004 23:16:11 +0000 (23:16 +0000)]
Encode and decode more characters. Don't put commas after every
character. Don't encode whitespace as "...". Don't fail decoding
across a 1024-byte boundary. Mark end of message appropriately. From
OpenBSD but with punctuation taken from ITU-T Recommendation F.1
(03/98).
jsm [Sun, 8 Feb 2004 11:47:36 +0000 (11:47 +0000)]
Check large factor for being prime before applying Pollard's
algorithm; fixes "factor 2147483647111311". Correct comment;
algorithm is Pollard p-1, not Pollard rho. Increase base if p-1
algorithm reaches 1; fixes "factor 99999999999991". Testcases from
David A Bagley <bagleyd@tux.org>.
jsm [Thu, 1 Jan 2004 16:03:46 +0000 (16:03 +0000)]
When cleaning up, only close files that have been opened successfully.
When reporting errors for failing to open files, give error text
rather than errno number. Patch from Joey Hess <joey@kitenet.net> for
Debian bug 187251 from Mikael Hedin <micce@debian.org>.
jsm [Thu, 1 Jan 2004 16:02:07 +0000 (16:02 +0000)]
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>.
jsm [Thu, 1 Jan 2004 16:01:25 +0000 (16:01 +0000)]
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>.
jsm [Thu, 1 Jan 2004 15:59:58 +0000 (15:59 +0000)]
Only score as a Gammon or a Backgammon if the opponent hasn't removed
any pieces, not if the opponent has removed pieces but has had a piece
knocked back to the bar afterwards. Fixes Debian bug 185101 from
Konstantin Seiler <list@kseiler.de>.