diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 86692f3..0000000 --- a/.cvsignore +++ /dev/null @@ -1,12 +0,0 @@ -Makeconfig -hide-game -install-man -install-score -subst.sed -subst.rules -test.out -GNUmakefile -conftest.c -exec.libs.tmp -exec.objs.tmp -a.out diff --git a/COPYING b/COPYING index d3baec4..8e108fa 100644 --- a/COPYING +++ b/COPYING @@ -387,7 +387,7 @@ insofar as they get compiled into the games; note that the include files are probably irrelevant for this purpose as it is unlikely they are significant enough to make any binary a derived work). - Copyright (c) 1997-2004 Joseph Samuel Myers. + Copyright (c) 1997-2005 Joseph Samuel Myers. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -434,7 +434,7 @@ the compilation copyright on the package as a whole; ***this has yet to be confirmed with Andy Tefft***: Copyright (c) 1993 Curt Olson, Andy Tefft. - Copyright (c) 1997-2004 Joseph Samuel Myers. + Copyright (c) 1997-2005 Joseph Samuel Myers. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ChangeLog b/ChangeLog index 3fb7c1b..47084ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,207 @@ +2005-02-18 Joseph S. Myers + + * Version 2.17. + + * NEWS, bsd-games.lsm, bsd-games-non-free.lsm: Update. + + * wtf/acronyms, wtf/acronyms.comp: Update from NetBSD CVS. + +2005-02-16 Joseph S. Myers + + * atc/input.c, backgammon/backgammon/main.c, + backgammon/teachgammon/teach.c, cribbage/instr.c, fish/fish.c, + phantasia/gamesupport.c, phantasia/interplayer.c, phantasia/io.c, + phantasia/misc.c, phantasia/phantstruct.h, rogue/machdep.c, + rogue/rogue.h, trek/getpar.h, trek/trek.h, wump/wump.c: Update + from NetBSD CVS. + +2005-02-14 Joseph S. Myers + + * hack/hack.termcap.c: Remove "static" from some variables. Fix + from Andreas Jochens in Debian bug 284750. + * exec.objs: Include lib/strlcpy.o for atc and sail. + * atc/input.c, backgammon/backgammon/main.c, + backgammon/teachgammon/teach.c, cribbage/instr.c, fish/fish.c, + phantasia/misc.c, rogue/machdep.c, wump/wump.c: Cast last argument + of execl to char *. + * rogue/rogue.h: Avoid arrays of incomplete types. + * trek/trek.h: Likewise. Don't declare Skitab and Lentab here. + * trek/getpar.h: Declare Skitab and Lentab here. + * phantasia/phantstruct.h: Define phbool. + * phantasia/gamesupport.c, phantasia/interplayer.c, + phantasia/io.c, phantasia/misc.c: Use phbool where necessary. + + * .cvsignore, adventure/.cvsignore, arithmetic/.cvsignore, + atc/.cvsignore, backgammon/backgammon/.cvsignore, + backgammon/common_source/.cvsignore, + backgammon/teachgammon/.cvsignore, banner/.cvsignore, + battlestar/.cvsignore, bcd/.cvsignore, boggle/boggle/.cvsignore, + boggle/mkdict/.cvsignore, boggle/mkindex/.cvsignore, + caesar/.cvsignore, canfield/canfield/.cvsignore, + canfield/cfscores/.cvsignore, cribbage/.cvsignore, dab/.cvsignore, + dm/.cvsignore, factor/.cvsignore, fish/.cvsignore, + fortune/datfiles/.cvsignore, fortune/fortune/.cvsignore, + fortune/strfile/.cvsignore, fortune/unstr/.cvsignore, + gomoku/.cvsignore, hack/.cvsignore, hangman/.cvsignore, + hunt/hunt/.cvsignore, hunt/huntd/.cvsignore, include/.cvsignore, + lib/.cvsignore, mille/.cvsignore, monop/.cvsignore, + morse/.cvsignore, number/.cvsignore, phantasia/.cvsignore, + pig/.cvsignore, pom/.cvsignore, ppt/.cvsignore, primes/.cvsignore, + quiz/.cvsignore, quiz/datfiles/.cvsignore, rain/.cvsignore, + random/.cvsignore, robots/.cvsignore, rogue/.cvsignore, + sail/.cvsignore, snake/snake/.cvsignore, snake/snscore/.cvsignore, + tetris/.cvsignore, trek/.cvsignore, worm/.cvsignore, + worms/.cvsignore, wtf/.cvsignore, wump/.cvsignore: Remove as no + longer needed after move to Subversion. + +2005-01-30 Joseph S. Myers + + * fortune/datfiles/fortunes2: Update from NetBSD CVS. + +2005-01-30 Joseph S. Myers + + * wtf/acronyms, wtf/acronyms.comp: Update from NetBSD CVS. + * COPYING: Update copyright dates. + +2004-12-23 Joseph S. Myers + + * monop/malloc.c, phantasia/main.c, phantasia/setup.c: Update from + NetBSD CVS. + +2004-12-07 Joseph S. Myers + + * arithmetic/arithmetic.c, battlestar/getcom.c, + boggle/boggle/bog.c, boggle/boggle/mach.c, + canfield/canfield/canfield.c, cribbage/io.c, dm/dm.c, + fortune/fortune/fortune.c, gomoku/stoc.c, hack/hack.u_init.c, + hangman/getword.c, hunt/hunt/hunt.c, hunt/hunt/otto.c, + hunt/huntd/answer.c, mille/move.c, monop/getinp.c, monop/misc.c, + number/number.c, pig/pig.c, robots/main.c, sail/dr_1.c, + sail/misc.c, sail/pl_4.c, sail/pl_5.c, worms/Makefile.bsd, + wtf/acronyms, wtf/acronyms.comp: Update from NetBSD CVS. + +2004-10-31 Joseph S. Myers + + * lib/fgetln.c: Handle case of line just fitting in buffer + correctly. + +2004-10-23 Joseph S. Myers + + * dm/utmpentry.c: Update from NetBSD CVS. + +2004-09-15 Joseph S. Myers + + * fortune/fortune/fortune.6.in, fortune/strfile/strfile.8, + worms/worms.c: Update from NetBSD CVS. + +2004-09-08 Joseph S. Myers + + * atc/log.c, sail/dr_1.c, sail/sync.c: Update from NetBSD CVS. + +2004-09-04 Joseph S. Myers + + * wtf/acronyms: Update from NetBSD CVS. + +2004-09-02 Joseph S. Myers + + * robots/auto.c, robots/move.c: Update from NetBSD CVS. + +2004-08-23 Joseph S. Myers + + * fortune/datfiles/fortunes: Update from NetBSD CVS. + +2004-07-16 Joseph S. Myers + + * wtf/acronyms.comp: Update from NetBSD CVS. + +2004-07-05 Joseph S. Myers + + * wtf/acronyms: Update from NetBSD CVS. + +2004-06-07 Joseph S. Myers + + * wtf/acronyms.comp: Update from NetBSD CVS. + +2004-06-02 Joseph S. Myers + + * hack/hack.6.in: Update from NetBSD CVS. + +2004-05-24 Joseph S. Myers + + * fortune/datfiles/fortunes: Update from NetBSD CVS. + +2004-05-20 Joseph S. Myers + + * wtf/acronyms.comp: Update from NetBSD CVS. + +2004-05-02 Joseph S. Myers + + * rain/rain.c: Update from NetBSD CVS. + * exec.objs: Update. + +2004-04-30 Joseph S. Myers + + * wtf/acronyms.comp: Update from NetBSD CVS. + +2004-04-24 Joseph S. Myers + + * backgammon/common_source/fancy.c, fortune/datfiles/farber: + Update from NetBSD CVS. + +2004-04-12 Joseph S. Myers + + * phantasia/fight.c, phantasia/gamesupport.c, + phantasia/interplayer.c, phantasia/io.c, phantasia/main.c, + phantasia/misc.c: Update from NetBSD CVS. + +2004-04-08 Joseph S. Myers + + * mille/move.c, phantasia/fight.c, phantasia/gamesupport.c, + phantasia/include.h, phantasia/interplayer.c, phantasia/io.c, + phantasia/main.c, phantasia/misc.c, phantasia/phantstruct.h, + phantasia/setup.c, worms/worms.c, wtf/acronyms, wtf/acronyms.comp: + Update from NetBSD CVS. + +2004-03-29 Joseph S. Myers + + * fortune/datfiles/fortunes2, fortune/datfiles/fortunes2-o.real, + hack/data, hack/rumors: Update from NetBSD CVS. + +2004-03-27 Joseph S. Myers + + * wtf/acronyms, wtf/acronyms.comp: Update from NetBSD CVS. + +2004-03-12 Joseph S. Myers + + * wtf/acronyms, wtf/acronyms.comp: Update from NetBSD CVS. + +2004-03-05 Joseph S. Myers + + * wtf/acronyms: Update from NetBSD CVS. + +2004-03-04 Joseph S. Myers + + * wtf/acronyms.comp: Update from NetBSD CVS. + +2004-02-28 Joseph S. Myers + + * fortune/datfiles/fortunes2: Update from NetBSD CVS. + +2004-02-18 Joseph S. Myers + + * wtf/acronyms: Update from NetBSD CVS. + +2004-02-14 Joseph S. Myers + + * fortune/datfiles/fortunes, fortune/datfiles/fortunes.sp.ok, + rogue/USD.doc/rogue.me: Update from NetBSD CVS. + * NEWS: Fix typo. + * ChangeLog: Mark properly for 2.16 release. + 2004-02-13 Joseph S. Myers + * Version 2.16. + * NEWS, bsd-games.lsm, bsd-games-non-free.lsm: Update. * morse/morse.c: Update from NetBSD CVS. diff --git a/NEWS b/NEWS index bcf5347..141948b 100644 --- a/NEWS +++ b/NEWS @@ -11,10 +11,18 @@ changes in installation instructions. Packagers should also reread the PACKAGING file each version (or do a diff between the old and new versions of the package and read that). +Version 2.17 (2005-02-18) +============ + +* Updated from NetBSD CVS of 2005-02-18. + +* Some bugs fixed (in particular, should now build with current GCC 4 +CVS), some backlogged. + Version 2.16 (2004-02-13) ============ -* Updated from NetBSD CVS of 2004-02-12. Includes a new game, dab +* Updated from NetBSD CVS of 2004-02-13. Includes a new game, dab (Dots and Boxes), written in C++. * Supplementary documentation for trek and rogue now installed diff --git a/adventure/.cvsignore b/adventure/.cvsignore deleted file mode 100644 index e47bc4b..0000000 --- a/adventure/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -adventure -setup -data.c diff --git a/arithmetic/.cvsignore b/arithmetic/.cvsignore deleted file mode 100644 index d019333..0000000 --- a/arithmetic/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -arithmetic diff --git a/arithmetic/arithmetic.c b/arithmetic/arithmetic.c index b3f6d82..61c97a7 100644 --- a/arithmetic/arithmetic.c +++ b/arithmetic/arithmetic.c @@ -1,4 +1,4 @@ -/* $NetBSD: arithmetic.c,v 1.20 2004/01/27 20:30:28 jsm Exp $ */ +/* $NetBSD: arithmetic.c,v 1.21 2004/11/05 21:30:31 dsl Exp $ */ /* * Copyright (c) 1989, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)arithmetic.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: arithmetic.c,v 1.20 2004/01/27 20:30:28 jsm Exp $"); +__RCSID("$NetBSD: arithmetic.c,v 1.21 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -246,8 +246,8 @@ retry: (void)printf("\n"); return(EOF); } - for (p = line; *p && isspace(*p); ++p); - if (!isdigit(*p)) { + for (p = line; *p && isspace((unsigned char)*p); ++p); + if (!isdigit((unsigned char)*p)) { (void)printf("Please type a number.\n"); continue; } diff --git a/atc/.cvsignore b/atc/.cvsignore deleted file mode 100644 index b9d111e..0000000 --- a/atc/.cvsignore +++ /dev/null @@ -1,13 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -atc -pathnames.h -atc.6 -grammar.c -grammar.h -y.tab.* -lex.c -lex.yy.c diff --git a/atc/input.c b/atc/input.c index d628553..68cfe75 100644 --- a/atc/input.c +++ b/atc/input.c @@ -1,4 +1,4 @@ -/* $NetBSD: input.c,v 1.16 2004/01/27 20:30:28 jsm Exp $ */ +/* $NetBSD: input.c,v 1.17 2005/02/15 12:56:20 jsm Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -46,7 +46,7 @@ #if 0 static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: input.c,v 1.16 2004/01/27 20:30:28 jsm Exp $"); +__RCSID("$NetBSD: input.c,v 1.17 2005/02/15 12:56:20 jsm Exp $"); #endif #endif /* not lint */ @@ -322,10 +322,10 @@ gettoken() base = shell; else base++; - execl(shell, base, 0); + execl(shell, base, (char *) 0); } else - execl(_PATH_BSHELL, "sh", 0); + execl(_PATH_BSHELL, "sh", (char *) 0); exit(0); /* oops */ } diff --git a/atc/log.c b/atc/log.c index 5f5d9bf..a92aaae 100644 --- a/atc/log.c +++ b/atc/log.c @@ -1,4 +1,4 @@ -/* $NetBSD: log.c,v 1.12 2003/08/07 09:36:54 agc Exp $ */ +/* $NetBSD: log.c,v 1.13 2004/09/07 13:20:39 jrf Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -46,7 +46,7 @@ #if 0 static char sccsid[] = "@(#)log.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: log.c,v 1.12 2003/08/07 09:36:54 agc Exp $"); +__RCSID("$NetBSD: log.c,v 1.13 2004/09/07 13:20:39 jrf Exp $"); #endif #endif /* not lint */ @@ -180,8 +180,7 @@ log_score(list_em) } strcpy(thisscore.name, pw->pw_name); uname(&name); - strncpy(thisscore.host, name.nodename, sizeof(thisscore.host)-1); - thisscore.host[sizeof(thisscore.host) - 1] = '\0'; + strlcpy(thisscore.host, name.nodename, sizeof(thisscore.host)); cp = strrchr(file, '/'); if (cp == NULL) { diff --git a/backgammon/backgammon/.cvsignore b/backgammon/backgammon/.cvsignore deleted file mode 100644 index 10fe2bf..0000000 --- a/backgammon/backgammon/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -backgammon -backgammon.6 diff --git a/backgammon/backgammon/main.c b/backgammon/backgammon/main.c index 809cccd..f0b8843 100644 --- a/backgammon/backgammon/main.c +++ b/backgammon/backgammon/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.20 2004/02/08 22:23:50 jsm Exp $ */ +/* $NetBSD: main.c,v 1.21 2005/02/15 12:56:20 jsm Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: main.c,v 1.20 2004/02/08 22:23:50 jsm Exp $"); +__RCSID("$NetBSD: main.c,v 1.21 2005/02/15 12:56:20 jsm Exp $"); #endif #endif /* not lint */ @@ -152,7 +152,8 @@ main(argc, argv) if (yorn(0)) { fixtty(&old); /* restore tty */ - execl(TEACH, "teachgammon", args[1]?args:0, 0); + execl(TEACH, "teachgammon", args[1]?args:0, + (char *) 0); tflag = 0; /* error! */ writel(noteach); diff --git a/backgammon/common_source/.cvsignore b/backgammon/common_source/.cvsignore deleted file mode 100644 index 84a962b..0000000 --- a/backgammon/common_source/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp diff --git a/backgammon/common_source/fancy.c b/backgammon/common_source/fancy.c index fc5720f..9438070 100644 --- a/backgammon/common_source/fancy.c +++ b/backgammon/common_source/fancy.c @@ -1,4 +1,4 @@ -/* $NetBSD: fancy.c,v 1.11 2003/08/07 09:36:57 agc Exp $ */ +/* $NetBSD: fancy.c,v 1.12 2004/04/23 02:58:27 simonb Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)fancy.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: fancy.c,v 1.11 2003/08/07 09:36:57 agc Exp $"); +__RCSID("$NetBSD: fancy.c,v 1.12 2004/04/23 02:58:27 simonb Exp $"); #endif #endif /* not lint */ @@ -591,7 +591,7 @@ fancyc(c) addbuf(c); return; } - /* process tabs, use spaces if the the tab should be erasing things, + /* process tabs, use spaces if the tab should be erasing things, * otherwise use cursor movement routines. Note this does not use * hardware tabs at all. */ if (c == '\t') { diff --git a/backgammon/teachgammon/.cvsignore b/backgammon/teachgammon/.cvsignore deleted file mode 100644 index 3c44fe7..0000000 --- a/backgammon/teachgammon/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -teachgammon diff --git a/backgammon/teachgammon/teach.c b/backgammon/teachgammon/teach.c index 15e0e06..7a40cc8 100644 --- a/backgammon/teachgammon/teach.c +++ b/backgammon/teachgammon/teach.c @@ -1,4 +1,4 @@ -/* $NetBSD: teach.c,v 1.15 2004/02/08 22:23:50 jsm Exp $ */ +/* $NetBSD: teach.c,v 1.16 2005/02/15 12:56:20 jsm Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: teach.c,v 1.15 2004/02/08 22:23:50 jsm Exp $"); +__RCSID("$NetBSD: teach.c,v 1.16 2005/02/15 12:56:20 jsm Exp $"); #endif #endif /* not lint */ @@ -152,7 +152,7 @@ leave() else writec('\n'); fixtty(&old); - execl(EXEC, "backgammon", "-n", args[1]?args:0, 0); + execl(EXEC, "backgammon", "-n", args[1]?args:0, (char *) 0); writel("Help! Backgammon program is missing\007!!\n"); exit(1); } diff --git a/banner/.cvsignore b/banner/.cvsignore deleted file mode 100644 index 8d7e748..0000000 --- a/banner/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -banner diff --git a/battlestar/.cvsignore b/battlestar/.cvsignore deleted file mode 100644 index 145d18e..0000000 --- a/battlestar/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -battlestar -pathnames.h diff --git a/battlestar/getcom.c b/battlestar/getcom.c index 29a3456..1b60e11 100644 --- a/battlestar/getcom.c +++ b/battlestar/getcom.c @@ -1,4 +1,4 @@ -/* $NetBSD: getcom.c,v 1.11 2003/08/07 09:37:02 agc Exp $ */ +/* $NetBSD: getcom.c,v 1.12 2004/11/05 21:30:31 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getcom.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getcom.c,v 1.11 2003/08/07 09:37:02 agc Exp $"); +__RCSID("$NetBSD: getcom.c,v 1.12 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -54,7 +54,7 @@ getcom(buf, size, prompt, error) clearerr(stdin); continue; } - while (isspace(*buf)) + while (isspace((unsigned char)*buf)) buf++; if (*buf) break; @@ -83,25 +83,25 @@ getword(buf1, buf2, flag) int cnt; cnt = 1; - while (isspace(*buf1)) + while (isspace((unsigned char)*buf1)) buf1++; if (*buf1 != ',') { if (!*buf1) { *buf2 = 0; return (0); } - while (cnt < WORDLEN && *buf1 && !isspace(*buf1) && *buf1 != ',') + while (cnt < WORDLEN && *buf1 && !isspace((unsigned char)*buf1) && *buf1 != ',') if (flag < 0) { - if (isupper(*buf1)) { - *buf2++ = tolower(*buf1++); + if (isupper((unsigned char)*buf1)) { + *buf2++ = tolower((unsigned char)*buf1++); cnt++; } else { *buf2++ = *buf1++; cnt++; } } else if (flag > 0) { - if (islower(*buf1)) { - *buf2++ = toupper(*buf1++); + if (islower((unsigned char)*buf1)) { + *buf2++ = toupper((unsigned char)*buf1++); cnt++; } else { *buf2++ = *buf1++; @@ -112,12 +112,12 @@ getword(buf1, buf2, flag) cnt++; } if (cnt == WORDLEN) - while (*buf1 && !isspace(*buf1)) + while (*buf1 && !isspace((unsigned char)*buf1)) buf1++; } else *buf2++ = *buf1++; *buf2 = '\0'; - while (isspace(*buf1)) + while (isspace((unsigned char)*buf1)) buf1++; return (*buf1 ? buf1 : NULL); } diff --git a/bcd/.cvsignore b/bcd/.cvsignore deleted file mode 100644 index 8d88563..0000000 --- a/bcd/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -bcd diff --git a/boggle/boggle/.cvsignore b/boggle/boggle/.cvsignore deleted file mode 100644 index 8804584..0000000 --- a/boggle/boggle/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -boggle -bog.h diff --git a/boggle/boggle/bog.c b/boggle/boggle/bog.c index e3c3e67..276969b 100644 --- a/boggle/boggle/bog.c +++ b/boggle/boggle/bog.c @@ -1,4 +1,4 @@ -/* $NetBSD: bog.c,v 1.18 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: bog.c,v 1.19 2004/11/05 21:30:31 dsl Exp $ */ /*- * Copyright (c) 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\n\ #if 0 static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: bog.c,v 1.18 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: bog.c,v 1.19 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -180,7 +180,7 @@ main(argc, argv) } if (argc > 0) { - if (islower(argv[0][0])) { + if (islower((unsigned char)argv[0][0])) { if (strlen(argv[0]) != 16) { usage(); } else { diff --git a/boggle/boggle/mach.c b/boggle/boggle/mach.c index bf70d73..b511296 100644 --- a/boggle/boggle/mach.c +++ b/boggle/boggle/mach.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach.c,v 1.13 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: mach.c,v 1.14 2004/11/05 21:30:31 dsl Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)mach.c 8.1 (Berkeley) 6/11/93"; #else -__RCSID("$NetBSD: mach.c,v 1.13 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: mach.c,v 1.14 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -445,7 +445,7 @@ findword() if (board[wordpath[i]] == 'q') printw("Qu"); else - printw("%c", toupper(board[wordpath[i]])); + printw("%c", toupper((unsigned char)board[wordpath[i]])); move(r, c); refresh(); delay(5); @@ -460,7 +460,7 @@ findword() if (board[wordpath[i]] == 'q') printw("Qu"); else - printw("%c", toupper(board[wordpath[i]])); + printw("%c", toupper((unsigned char)board[wordpath[i]])); } move(r, c); clrtoeol(); @@ -668,7 +668,7 @@ tty_showboard(b) if (b[i] == 'q') printw("| Qu"); else - printw("| %c ", toupper(b[i])); + printw("| %c ", toupper((unsigned char)b[i])); if ((i + 1) % 4 == 0) { printw("|"); move(++line, BOARD_COL); diff --git a/boggle/mkdict/.cvsignore b/boggle/mkdict/.cvsignore deleted file mode 100644 index a0b3cf5..0000000 --- a/boggle/mkdict/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -mkdict -dictionary diff --git a/boggle/mkindex/.cvsignore b/boggle/mkindex/.cvsignore deleted file mode 100644 index 8890b9a..0000000 --- a/boggle/mkindex/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -mkindex -dictindex diff --git a/bsd-games.lsm b/bsd-games.lsm index 424003b..9434bef 100644 --- a/bsd-games.lsm +++ b/bsd-games.lsm @@ -1,7 +1,7 @@ Begin4 Title: bsd-games -Version: 2.16 -Entered-date: 2004-02-13 +Version: 2.17 +Entered-date: 2005-02-18 Description: Port of most of the games from NetBSD-current. Games included: adventure arithmetic atc backgammon banner battlestar bcd boggle caesar canfield countmail cribbage dab dm factor fish @@ -11,7 +11,7 @@ Description: Port of most of the games from NetBSD-current. Games Keywords: games, NetBSD Maintained-by: jsm@polyomino.org.uk (Joseph S. Myers) Primary-site: ibiblio.org /pub/Linux/games - bsd-games-2.16.tar.gz + bsd-games-2.17.tar.gz Alternate-site: tsx-11.mit.edu /pub/linux/sources/usr.games Original-site: ftp.netbsd.org /pub/NetBSD/NetBSD-current/tar_files/src games.tar.gz diff --git a/caesar/.cvsignore b/caesar/.cvsignore deleted file mode 100644 index fab0e2c..0000000 --- a/caesar/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -caesar -rot13 diff --git a/canfield/canfield/.cvsignore b/canfield/canfield/.cvsignore deleted file mode 100644 index 34d6544..0000000 --- a/canfield/canfield/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -canfield -pathnames.h -canfield.6 diff --git a/canfield/canfield/canfield.c b/canfield/canfield/canfield.c index cbdc404..1aa1d3f 100644 --- a/canfield/canfield/canfield.c +++ b/canfield/canfield/canfield.c @@ -1,4 +1,4 @@ -/* $NetBSD: canfield.c,v 1.19 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: canfield.c,v 1.20 2004/11/05 21:30:31 dsl Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)canfield.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: canfield.c,v 1.19 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: canfield.c,v 1.20 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -1400,7 +1400,7 @@ getcmd(row, col, cp) suspend(); move(row, col + i); refresh(); - } else if (isprint(ch)) { + } else if (isprint((unsigned char)ch)) { cmd[i++] = ch; addch(ch); refresh(); diff --git a/canfield/cfscores/.cvsignore b/canfield/cfscores/.cvsignore deleted file mode 100644 index dd6ea38..0000000 --- a/canfield/cfscores/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -cfscores diff --git a/cribbage/.cvsignore b/cribbage/.cvsignore deleted file mode 100644 index 9c1f51e..0000000 --- a/cribbage/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -cribbage -pathnames.h -cribbage.6 diff --git a/cribbage/instr.c b/cribbage/instr.c index 823f9f5..f4d9d80 100644 --- a/cribbage/instr.c +++ b/cribbage/instr.c @@ -1,4 +1,4 @@ -/* $NetBSD: instr.c,v 1.10 2003/08/07 09:37:10 agc Exp $ */ +/* $NetBSD: instr.c,v 1.11 2005/02/15 12:56:20 jsm Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)instr.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: instr.c,v 1.10 2003/08/07 09:37:10 agc Exp $"); +__RCSID("$NetBSD: instr.c,v 1.11 2005/02/15 12:56:20 jsm Exp $"); #endif #endif /* not lint */ @@ -85,7 +85,7 @@ instructions() warn("dup2"); _exit(1); } - execl("/bin/sh", "sh", "-c", path, NULL); + execl("/bin/sh", "sh", "-c", path, (char *) NULL); warn(NULL); _exit(1); default: diff --git a/cribbage/io.c b/cribbage/io.c index 591e0c4..3d69257 100644 --- a/cribbage/io.c +++ b/cribbage/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.17 2004/01/26 09:58:35 jsm Exp $ */ +/* $NetBSD: io.c,v 1.18 2004/11/05 21:30:31 dsl Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: io.c,v 1.17 2004/01/26 09:58:35 jsm Exp $"); +__RCSID("$NetBSD: io.c,v 1.18 2004/11/05 21:30:31 dsl Exp $"); #endif #endif /* not lint */ @@ -353,10 +353,10 @@ number(lo, hi, prompt) } sum = 0; - if (!isdigit(*p)) + if (!isdigit((unsigned char)*p)) sum = lo - 1; else - while (isdigit(*p)) { + while (isdigit((unsigned char)*p)) { sum = 10 * sum + (*p - '0'); ++p; } @@ -424,8 +424,8 @@ endmsg() /* All messages should start with uppercase */ mvaddch(lastline + Y_MSG_START, SCORE_X, ' '); - if (islower(Msgbuf[0]) && Msgbuf[1] != ')') - Msgbuf[0] = toupper(Msgbuf[0]); + if (islower((unsigned char)Msgbuf[0]) && Msgbuf[1] != ')') + Msgbuf[0] = toupper((unsigned char)Msgbuf[0]); mp = Msgbuf; len = strlen(mp); if (len / MSG_X + Lineno >= MSG_Y) { diff --git a/dab/.cvsignore b/dab/.cvsignore deleted file mode 100644 index f99b379..0000000 --- a/dab/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.ii -*.s -*.d.tmp -dab diff --git a/debian/changelog b/debian/changelog index d9c17ef..dd15eae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +bsdgames (2.17-1) unstable; urgency=low + + * New upstream release. + + -- Joey Hess Fri, 18 Feb 2005 13:12:51 -0500 + bsdgames (2.16-5) unstable; urgency=low * Apply hack patch from Andreas Jochens to support building under gcc 4.0 diff --git a/dm/.cvsignore b/dm/.cvsignore deleted file mode 100644 index 3cae706..0000000 --- a/dm/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -dm -pathnames.h -dm.8 -dm.conf.5 diff --git a/dm/dm.c b/dm/dm.c index a5918ce..c131904 100644 --- a/dm/dm.c +++ b/dm/dm.c @@ -1,4 +1,4 @@ -/* $NetBSD: dm.c,v 1.20 2004/02/08 22:23:50 jsm Exp $ */ +/* $NetBSD: dm.c,v 1.21 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1987, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\ #if 0 static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: dm.c,v 1.20 2004/02/08 22:23:50 jsm Exp $"); +__RCSID("$NetBSD: dm.c,v 1.21 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -173,7 +173,7 @@ c_day(s_day, s_start, s_stop) ct = localtime(&now); if (strcasecmp(s_day, days[ct->tm_wday])) return; - if (!isdigit(*s_start) || !isdigit(*s_stop)) + if (!isdigit((unsigned char)*s_start) || !isdigit((unsigned char)*s_stop)) return; start = atoi(s_start); stop = atoi(s_stop); @@ -221,11 +221,11 @@ c_game(s_game, s_load, s_users, s_priority) if (strcmp(game, s_game) && strcasecmp("default", s_game)) return; ++found; - if (isdigit(*s_load) && atoi(s_load) < load()) + if (isdigit((unsigned char)*s_load) && atoi(s_load) < load()) errx(0, "Sorry, the load average is too high right now."); - if (isdigit(*s_users) && atoi(s_users) <= users()) + if (isdigit((unsigned char)*s_users) && atoi(s_users) <= users()) errx(0, "Sorry, there are too many users logged on right now."); - if (isdigit(*s_priority)) + if (isdigit((unsigned char)*s_priority)) priority = atoi(s_priority); } diff --git a/dm/utmpentry.c b/dm/utmpentry.c index 7c42fe7..8488c4c 100644 --- a/dm/utmpentry.c +++ b/dm/utmpentry.c @@ -1,4 +1,4 @@ -/* $NetBSD: utmpentry.c,v 1.4 2003/02/12 17:39:36 christos Exp $ */ +/* $NetBSD: utmpentry.c,v 1.5 2004/10/22 15:50:47 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include #ifndef lint -__RCSID("$NetBSD: utmpentry.c,v 1.4 2003/02/12 17:39:36 christos Exp $"); +__RCSID("$NetBSD: utmpentry.c,v 1.5 2004/10/22 15:50:47 christos Exp $"); #endif #include @@ -94,6 +94,7 @@ setup(const char *fname) { int what = 3; struct stat st; + const char *sfname; if (fname == NULL) { #ifdef SUPPORT_UTMPX @@ -110,38 +111,49 @@ setup(const char *fname) if (what == 1) { #ifdef SUPPORT_UTMPX if (utmpxname(fname) == 0) - err(1, "Cannot open `%s'", fname); + warnx("Cannot set utmpx file to `%s'", + fname); #else - errx(1, "utmpx support not compiled in"); + warnx("utmpx support not compiled in"); #endif } else { #ifdef SUPPORT_UTMP if (utmpname(fname) == 0) - err(1, "Cannot open `%s'", fname); + warnx("Cannot set utmp file to `%s'", + fname); #else - errx(1, "utmp support not compiled in"); + warnx("utmp support not compiled in"); #endif } } #ifdef SUPPORT_UTMPX if (what & 1) { - (void)stat(fname ? fname : _PATH_UTMPX, &st); - if (st.st_mtime > utmpxtime) - utmpxtime = st.st_mtime; - else + sfname = fname ? fname : _PATH_UTMPX; + if (stat(sfname, &st) == -1) { + warn("Cannot stat `%s'", sfname); what &= ~1; + } else { + if (st.st_mtime > utmpxtime) + utmpxtime = st.st_mtime; + else + what &= ~1; + } } #endif #ifdef SUPPORT_UTMP if (what & 2) { - (void)stat(fname ? fname : _PATH_UTMP, &st); - if (st.st_mtime > utmptime) - utmptime = st.st_mtime; - else + sfname = fname ? fname : _PATH_UTMP; + if (stat(sfname, &st) == -1) { + warn("Cannot stat `%s'", sfname); what &= ~2; + } else { + if (st.st_mtime > utmptime) + utmptime = st.st_mtime; + else + what &= ~2; + } } #endif - return what; } #endif @@ -179,10 +191,13 @@ getutentries(const char *fname, struct utmpentry **epp) struct utmpentry *ep; int what = setup(fname); struct utmpentry **nextp = &ehead; - if (what == 0) { + switch (what) { + case 0: + /* No updates */ *epp = ehead; return numutmp; - } else { + default: + /* Need to re-scan */ ehead = NULL; numutmp = 0; } @@ -192,8 +207,10 @@ getutentries(const char *fname, struct utmpentry **epp) while ((what & 1) && (utx = getutxent()) != NULL) { if (fname == NULL && utx->ut_type != USER_PROCESS) continue; - if ((ep = calloc(1, sizeof(struct utmpentry))) == NULL) - err(1, NULL); + if ((ep = calloc(1, sizeof(struct utmpentry))) == NULL) { + warn(NULL); + return 0; + } getentryx(ep, utx); *nextp = ep; nextp = &(ep->next); @@ -213,8 +230,10 @@ getutentries(const char *fname, struct utmpentry **epp) } if (ep != NULL) continue; - if ((ep = calloc(1, sizeof(struct utmpentry))) == NULL) - err(1, NULL); + if ((ep = calloc(1, sizeof(struct utmpentry))) == NULL) { + warn(NULL); + return 0; + } getentry(ep, ut); *nextp = ep; nextp = &(ep->next); diff --git a/exec.objs b/exec.objs index 9ca6ffa..f081d60 100644 --- a/exec.objs +++ b/exec.objs @@ -1,7 +1,7 @@ # exec.objs - details of objects that go into bsd-games programs. # This file is used for automatic makefile generation. # -# Copyright (c) 1998, 1999, 2000, 2001, 2003, 2004 Joseph Samuel Myers. +# Copyright (c) 1998, 1999, 2000, 2001, 2003, 2004, 2005 Joseph Samuel Myers. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ adventure crc.o data.o done.o init.o io.o main.o save.o subr.o \ adventure/setup setup.o arithmetic arithmetic.o lib/getprogname.o atc extern.o grammar.o graphics.o input.o lex.o list.o \ - log.o main.o tunable.o update.o + log.o main.o tunable.o update.o lib/strlcpy.o backgammon/backgammon/backgammon extra.o main.o move.o text.o \ version.o backgammon/common_source/allow.o \ backgammon/common_source/board.o backgammon/common_source/check.o \ @@ -102,7 +102,7 @@ pom pom.o ppt ppt.o primes pattern.o pr_tbl.o primes.o quiz quiz.o rxp.o lib/fgetln.o -rain rain.o +rain rain.o lib/getprogname.o random random.o robots auto.o extern.o flush_in.o init_field.o main.o \ make_level.o move.o move_robs.o play_level.o query.o rnd_pos.o score.o @@ -112,7 +112,8 @@ rogue hit.o init.o inventory.o level.o machdep.o main.o \ lib/strlcpy.o sail assorted.o game.o globals.o dr_1.o dr_2.o dr_3.o \ dr_4.o dr_5.o dr_main.o lo_main.o main.o misc.o parties.o pl_1.o \ - pl_2.o pl_3.o pl_4.o pl_5.o pl_6.o pl_7.o pl_main.o sync.o version.o + pl_2.o pl_3.o pl_4.o pl_5.o pl_6.o pl_7.o pl_main.o sync.o version.o \ + lib/strlcpy.o snake/snake/snake snake.o snake/snscore/snscore snscore.o tetris input.o scores.o screen.o shapes.o tetris.o diff --git a/factor/.cvsignore b/factor/.cvsignore deleted file mode 100644 index 4310a24..0000000 --- a/factor/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -factor diff --git a/fish/.cvsignore b/fish/.cvsignore deleted file mode 100644 index 0622c1f..0000000 --- a/fish/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -fish -pathnames.h diff --git a/fish/fish.c b/fish/fish.c index 8704964..ddb78fb 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -1,4 +1,4 @@ -/* $NetBSD: fish.c,v 1.15 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: fish.c,v 1.16 2005/02/15 12:56:20 jsm Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993\n\ #if 0 static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: fish.c,v 1.15 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: fish.c,v 1.16 2005/02/15 12:56:20 jsm Exp $"); #endif #endif /* not lint */ @@ -472,7 +472,7 @@ instructions() err(1, "open %s", _PATH_INSTR); if (dup2(fd, 0) == -1) err(1, "dup2"); - (void)execl("/bin/sh", "sh", "-c", pager, NULL); + (void)execl("/bin/sh", "sh", "-c", pager, (char *) NULL); err(1, "exec sh -c %s", pager); /*NOTREACHED*/ case -1: diff --git a/fortune/datfiles/.cvsignore b/fortune/datfiles/.cvsignore deleted file mode 100644 index e904edb..0000000 --- a/fortune/datfiles/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -*.dat -*-o diff --git a/fortune/datfiles/farber b/fortune/datfiles/farber index 064dbb5..294d1a7 100644 --- a/fortune/datfiles/farber +++ b/fortune/datfiles/farber @@ -1121,7 +1121,7 @@ It's the other end of the kettle of fish. % It's the straw that broke the ice. % -It's the the highest of the lows. +It's the highest of the lows. % It's the vilest smell I ever heard. % diff --git a/fortune/datfiles/fortunes b/fortune/datfiles/fortunes index be6b88f..c24de4f 100644 --- a/fortune/datfiles/fortunes +++ b/fortune/datfiles/fortunes @@ -109,7 +109,7 @@ You patch a bug, and dump it again: % A "No" uttered from deepest conviction is better and greater than a "Yes" merely uttered to please, or what is worse, to avoid trouble. - -- Mahatma Ghandi + -- Mahatma Gandhi % A [golf] ball hitting a tree shall be deemed not to have hit the tree. Hitting a tree is simply bad luck and has no place in a scientific @@ -191,7 +191,7 @@ A closed mouth gathers no foot. A conclusion is simply the place where someone got tired of thinking. % A CONS is an object which cares. - -- Bernie Greenberg. + -- Bernie Greenberg % A consultant is a person who borrows your watch, tells you what time it is, pockets the watch, and sends you a bill for it. @@ -550,7 +550,7 @@ ov ould doderez -- tu riplais "ch", "sh", and "th" rispektivli. hev a lojikl, kohirnt speling in ius xrewawt xe Ingliy-spiking werld. % A power so great, it can only be used for Good or Evil! - -- Firesign Theatre, "The Giant Rat of Sumatra" + -- The Firesign Theatre, "The Giant Rat of Sumatra" % A priest asked: What is Fate, Master? @@ -583,7 +583,7 @@ A professor is one who talks in someone else's sleep. % A programmer is a person who passes as an exacting expert on the basis of being able to turn out, after innumerable punching, an infinite -series of incomprehensive answers calculated with micrometric +series of incomprehensible answers calculated with micrometric precisions from vague assumptions based on debatable figures taken from inconclusive documents and carried out on instruments of problematical accuracy by persons of dubious reliability and questionable mentality @@ -1071,7 +1071,7 @@ every organism to live beyond its income. -- Samuel Butler, "Notebooks" % All science is either physics or stamp collecting. - -- E. Rutherford + -- Ernest Rutherford % All snakes who wish to remain in Ireland will please raise their right hands. @@ -1610,7 +1610,7 @@ imagine the grandeur and scope of a program that would take as long? -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 % Art is anything you can get away with. - -- Marshall McLuhan. + -- Marshall McLuhan % Art is either plagiarism or revolution. -- Paul Gauguin @@ -2008,7 +2008,7 @@ both Parliament and Party. It stands today, a monument to human spirit. If life exists on other planets, this may be the first message received from us. - -- The Realist, November, 1964. + -- The Realist, November, 1964 % Beware of bugs in the above code; I have only proved it correct, not tried it. @@ -2132,7 +2132,7 @@ when they are between the ages of 18 months and 90 years. -- James Thurber % Boys will be boys, and so will a lot of middle-aged men. - -- Kin Hubbard + -- Kim Hubbard % Brace yourselves. We're about to try something that borders on the unique: an actually rather serious technical book which is not only @@ -2772,7 +2772,7 @@ Computers will not be perfected until they can compute how much more than the estimate the job will cost. % Conceit causes more conversation than wit. - -- LaRouchefoucauld + -- La Rochefoucauld % Concept, n.: Any "idea" for which an outside consultant billed you more than @@ -2792,7 +2792,7 @@ Confidence is the feeling you have before you understand the situation. % Congratulations! You have purchased an extremely fine device that would give you thousands of years of trouble-free service, except that -you undoubtably will destroy it via some typical bonehead consumer +you undoubtedly will destroy it via some typical bonehead consumer maneuver. Which is why we ask you to PLEASE FOR GOD'S SAKE READ THIS OWNER'S MANUAL CAREFULLY BEFORE YOU UNPACK THE DEVICE. YOU ALREADY UNPACKED IT, DIDN'T YOU? YOU UNPACKED IT AND PLUGGED IT IN AND TURNED @@ -3027,7 +3027,7 @@ blessed. default, n.: [Possibly from Black English "De fault wid dis system is you, mon."] The vain attempt to avoid errors by inactivity. "Nothing will -come of nothing: speak again." -- King Lear. +come of nothing: speak again." -- King Lear -- Stan Kelly-Bootle, "The Devil's DP Dictionary" % #define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255) @@ -3451,7 +3451,7 @@ the plastic underneath -- black. According to the instructions, this means the puzzle is solved. -- Steve Rubenstein % -Eat drink and be merry, for tomorrow they may make it illegal. +Eat, drink, and be merry, for tomorrow they may make it illegal. % Eat, drink, and be merry, for tomorrow you may work. % @@ -3641,7 +3641,7 @@ spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. This is not a way of life at all in any true sense. Under the clouds of war, it is humanity hanging on a cross of iron. - -- Dwight Eisenhower, April 16, 1953 + -- Dwight D. Eisenhower, April 16, 1953 % Every Horse has an Infinite Number of Legs (proof by intimidation): @@ -4155,7 +4155,7 @@ For years a secret shame destroyed my peace -- I'd not read Eliot, Auden or MacNiece. But now I think a thought that brings me hope: Neither had Chaucer, Shakespeare, Milton, Pope. - -- Justin Richardson. + -- Justin Richardson % For your penance, say five Hail Marys and one loud BLAH! % @@ -4287,7 +4287,7 @@ A: He told me, he says, "I have to kill you because you can identify Q: Did he kill you? A: No. % -fortune: cpu time/usefulness ratio too high -- core dumped. +fortune: CPU time/usefulness ratio too high -- core dumped. % Fortune: You will be attacked next Wednesday at 3:15 p.m. by six samurai sword wielding purple fish glued to Harley-Davidson motorcycles. @@ -4471,8 +4471,7 @@ think not, my friend, I think not. extracurricular activity except you." "Well, gee, doesn't Louise count?" "Only to ten, Mudhead." - - -- Firesign Theater + -- The Firesign Theatre % Gee, Toto, I don't think we are in Kansas anymore. % @@ -4752,7 +4751,7 @@ Goldenstern's Rules: % Good advice is something a man gives when he is too old to set a bad example. - -- La Rouchefoucauld + -- La Rochefoucauld % Good day for a change of scene. Repaper the bedroom wall. % @@ -4780,7 +4779,7 @@ well. % Gosh that takes me back... or is it forward? That's the trouble with time travel, you never can tell. - -- Doctor Who "Androids of Tara" + -- Doctor Who, "Androids of Tara" % Got Mole problems? Call Avogadro 6.02 x 10^23 @@ -5553,7 +5552,7 @@ I am not now, and never have been, a girlfriend of Henry Kissinger. -- Gloria Steinem % I am not now, nor have I ever been, a member of the demigodic party. - -- Dennis Ritchie + -- Dennis M. Ritchie % I am not sure what this is, but an `F' would only dignify it. -- English Professor @@ -5615,7 +5614,7 @@ I can read your mind, and you should be ashamed of yourself. I can remember when a good politician had to be 75 percent ability and 25 percent actor, but I can well see the day when the reverse could be true. - -- Harry Truman + -- Harry S. Truman % I can resist anything but temptation. % @@ -5820,7 +5819,7 @@ I found out why my car was humming. It had forgotten the words. % I gained nothing at all from Supreme Enlightenment, and for that very reason it is called Supreme Enlightenment. - -- Gotama Buddha + -- Gautama Buddha % I gave up Smoking, Drinking and Sex. It was the most *__________horrifying* 20 minutes of my life! @@ -5889,7 +5888,7 @@ have never met you, but if I do you'll need a new nose and plenty of beefsteak and perhaps a supporter below. Westbrook Pegler, a guttersnipe, is a gentleman compared to you. You can take that as more of an insult than as a reflection on your ancestry. - -- President Harry S Truman + -- President Harry S. Truman % I have learned To spell hors d'oeuvres @@ -6446,7 +6445,7 @@ And from that full meridian of my glory I haste now to my setting. I shall fall, Like a bright exhalation in the evening And no man see me more. - -- Shakespeare + -- William Shakespeare % IBM had a PL/I, Its syntax worse than JOSS; @@ -6700,7 +6699,7 @@ Sabbath-breaking, and from that to incivility and procrastination. -- Thomas De Quincey (1785 - 1859) % If one studies too zealously, one easily loses his pants. - -- A. Einstein. + -- Albert Einstein % If only God would give me some clear sign! Like making a large deposit in my name at a Swiss bank. @@ -6816,7 +6815,7 @@ If you can't be careful, give me a call. If you can't learn to do it well, learn to enjoy doing it badly. % If you cannot convince them, confuse them. - -- Harry S Truman + -- Harry S. Truman % If you didn't get caught, did you really do it? % @@ -7465,7 +7464,7 @@ Curiously enough, the dolphins had long known of the impending destruction of the of the planet Earth and had made many attempts to alert mankind to the danger; but most of their communications were misinterpreted ... - -- Douglas Adams "The Hitch-Hikers' Guide To The Galaxy" + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % It is better for civilization to be going down the drain than to be coming up it. @@ -8259,7 +8258,7 @@ weren't for other people. Life would be so much easier if we could just look at the source code. % Life, loathe it or ignore it, you can't like it. - -- Marvin, "Hitchhiker's Guide to the Galaxy" + -- Marvin, "The Hitchhiker's Guide to the Galaxy" % Like so many Americans, she was trying to construct a life that made sense from things she found in gift shops. @@ -8631,7 +8630,7 @@ Men were real men, women were real women, and small, furry creatures from Alpha Centauri were REAL small, furry creatures from Alpha Centauri. Spirits were brave, men boldly split infinitives that no man had split before. Thus was the Empire forged. - -- "The Hitchhiker's Guide to the Galaxy", Douglas Adams + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % Men's skin is different from women's skin. It is usually bigger, and it has more snakes tattooed on it. Also, if you examine a woman's skin @@ -9239,13 +9238,13 @@ Ninety-Ninety Rule of Project Schedules: The first ninety percent of the task takes ninety percent of the time, and the last ten percent takes the other ninety percent. % -Nirvana? Thats the place where the powers that be and their friends +Nirvana? That's the place where the powers that be and their friends hang out. -- Zonker Harris % No animal should ever jump on the dining room furniture unless absolutely certain he can hold his own in conversation. - -- Fran Lebowitz + -- Fran Leibowitz % No committee could ever come up with anything as revolutionary as a camel -- anything as practical and as perfectly designed to perform @@ -9361,7 +9360,7 @@ chipped at it a bit, and everything was just fine ... -- Stanislaw Lem, "Cyberiad" % Not Hercules could have knock'd out his brains, for he had none. - -- Shakespeare + -- William Shakespeare % Not only is this incomprehensible, but the ink is ugly and the paper is from the wrong kind of tree. @@ -9666,10 +9665,10 @@ each of us observes, in his own way, by going to the mall of his choice. In the old days, it was not called the Holiday Season; the Christians -called it "Christmas" and went to church; the Jews called it "Hanukka" +called it "Christmas" and went to church; the Jews called it "Hanukkah" and went to synagogue; the atheists went to parties and drank. People passing each other on the street would say "Merry Christmas!" or "Happy -Hanukka!" or (to the atheists) "Look out for the wall!" +Hanukkah!" or (to the atheists) "Look out for the wall!" -- Dave Barry, "Christmas Shopping: A Survivor's Guide" % Once at a social gathering, Gladstone said to Disraeli, "I predict, @@ -10344,7 +10343,7 @@ laughter, singing That's the way the chimney smokes Pope Goestheveezl -The square was finally cleared by armed carabineri with tears of +The square was finally cleared by armed carabinieri with tears of laughter streaming down their faces. The event set a record for hilarious civic functions, smashing the previous record set when Baron Hans Neizant B"ompzidaize was elected Landburgher of K"oln in 1653. @@ -10566,10 +10565,10 @@ Q: How many heterosexual males does it take to screw in a light bulb in San Francisco? A: Both of them. % -Q: How many IBM cpu's does it take to do a logical right shift? +Q: How many IBM CPUs does it take to do a logical right shift? A: 33. 1 to hold the bits and 32 to push the register. % -Q: How many IBM CPU's does it take to execute a job? +Q: How many IBM CPUs does it take to execute a job? A: Four; three to hold it down, and one to rip its head off. % Q: How many IBM types does it take to change a light bulb? @@ -11140,7 +11139,7 @@ pencil. Science is facts; just as houses are made of stones, so is science made of facts; but a pile of stones is not a house and a collection of facts is not necessarily science. - -- Henri Poincair'e + -- Henri Poincar'e % Science is what happens when preconception meets verification. % @@ -11269,7 +11268,7 @@ Sex is not the answer. Sex is the question. "Yes" is the answer. -- Swami X % Sex is the mathematics urge sublimated. - -- M. C. Reed. + -- M. C. Reed % Sex without love is an empty experience, but, as empty experiences go, it's one of the best. @@ -11588,7 +11587,7 @@ Sorry. I forget what I was going to say. Space is big. You just won't believe how vastly, hugely, mind- bogglingly big it is. I mean, you may think it's a long way down the road to the drug store, but that's just peanuts to space. - -- "The Hitchhiker's Guide to the Galaxy" + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % Spare no expense to save money on this one. -- Samuel Goldwyn @@ -11809,7 +11808,7 @@ Every now and then when your life gets complicated and the weasels start closing in, the only cure is to load up on heinous chemicals and then drive like a bastard from Hollywood to Las Vegas ... with the music at top volume and at least a pint of ether. - -- H.S. Thompson, "Fear and Loathing in Las Vegas" + -- H. S. Thompson, "Fear and Loathing in Las Vegas" % T: One big monster, he called TROLL. He don't rock, and he don't roll; @@ -12430,7 +12429,7 @@ down anything he damn well pleases. % The grand leap of the whale up the Fall of Niagara is esteemed, by all who have seen it, as one of the finest spectacles in nature. - -- Benjamin Franklin. + -- Benjamin Franklin % The Great Bald Swamp Hedgehog: The Great Bald Swamp Hedgehog of Billericay displays, in @@ -12573,7 +12572,7 @@ The lawgiver, of all beings, most owes the law allegiance. He of all men should behave as though the law compelled him. But it is the universal weakness of mankind that what we are given to administer we presently imagine we own. - -- H.G. Wells + -- H. G. Wells % THE LESSER-KNOWN PROGRAMMING LANGUAGES #10: SIMPLE @@ -12636,7 +12635,7 @@ who end up using this language. THE LESSER-KNOWN PROGRAMMING LANGUAGES #2: RENE Named after the famous French philosopher and mathematician Rene -DesCartes, RENE is a language used for artificial intelligence. The +Descartes, RENE is a language used for artificial intelligence. The language is being developed at the Chicago Center of Machine Politics and Programming under a grant from the Jane Byrne Victory Fund. A spokesman described the language as "Just as great as dis [sic] city of @@ -12715,7 +12714,7 @@ one has ever been. % The man who sets out to carry a cat by its tail learns something that will always be useful and which never will grow dim or doubtful. - -- Mark Twain. + -- Mark Twain % The marvels of today's modern technology include the development of a soda can, when discarded will last forever ... and a $7,000 car which @@ -12831,7 +12830,7 @@ The New York Times is read by the people who run the country. The Washington Post is read by the people who think they run the country. The National Enquirer is read by the people who think Elvis is alive and running the country ... - -- Robert J Woodhead + -- Robert J. Woodhead % The nice thing about standards is that there are so many of them to choose from. @@ -12913,7 +12912,7 @@ The opossum is a very sophisticated animal. It doesn't even get up until 5 or 6 p.m. % The opposite of a profound truth may well be another profound truth. - -- Bohr + -- Niels Bohr % The optimum committee has no members. -- Norman Augustine @@ -13056,7 +13055,7 @@ the insurance before running off to Germany where it lives in hiding. "The pyramid is opening!" "Which one?" "The one with the ever-widening hole in it!" - -- Firesign Theater, "How Can You Be In Two Places At + -- The Firesign Theatre, "How Can You Be In Two Places At Once When You're Not Anywhere At All" % The qotc (quote of the con) was Liz's: @@ -13325,7 +13324,7 @@ The Third Law: You can only break even at absolute zero. % The trouble with a kitten is that When it grows up, it's always a cat - -- Ogden Nash. + -- Ogden Nash % The trouble with being poor is that it takes up all your time. % @@ -13639,7 +13638,7 @@ inexplicable. There is another theory which states that this has already happened. - -- Douglas Adams, "The Hitch Hiker's Guide to the Galaxy" + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % There is hopeful symbolism in the fact that flags do not wave in a vacuum. -- Arthur C. Clarke @@ -13943,7 +13942,7 @@ This is your fortune. This land is full of trousers! this land is full of mausers! And pussycats to eat them when the sun goes down! - -- Firesign Theater + -- The Firesign Theatre % This land is made of mountains, This land is made of mud, @@ -13986,7 +13985,7 @@ student newspaper, of Tuesday, 3/10/87. which identifies errors in the original program. % This sentence contradicts itself -- no actually it doesn't. - -- Hofstadter + -- Douglas Hofstadter % ... This striving for excellence extends into people's personal lives as well. When '80s people buy something, they buy the best one, as @@ -14436,7 +14435,7 @@ unix soit qui mal y pense % UNIX was half a billion (500000000) seconds old on Tue Nov 5 00:53:20 1985 GMT (measuring since the time(2) epoch). - -- Andy Tannenbaum + -- Andrew S. Tanenbaum % Unnamed Law: If it happens, it must be possible. @@ -14622,7 +14621,7 @@ We are on the verge: Today our program proved Fermat's next-to-last theorem. -- Epigrams in Programming, ACM SIGPLAN Sept. 1982 % We are upping our standards ... so up yours. - -- Pat Paulsen for President, 1988. + -- Pat Paulsen for President, 1988 % We can defeat gravity. The problem is the paperwork involved. % @@ -14779,7 +14778,7 @@ Weiner's Law of Libraries: % Welcome thy neighbor into thy fallout shelter. He'll come in handy if you run out of food. - -- Dean McLaughlin. + -- Dean McLaughlin % Well, here it is, 1983, so it won't be long before you start reading a lot of boring stories about people like Vance Hartke. Hartke is a @@ -14830,7 +14829,7 @@ coefficient of relevance to Key of Time: zero." "Well," Brahma said, "even after ten thousand explanations, a fool is no wiser, but an intelligent man requires only two thousand five hundred." - -- The Mahabharata. + -- The Mahabharata % Westheimer's Discovery: A couple of months in the laboratory can frequently save a @@ -14868,7 +14867,7 @@ What garlic is to salad, insanity is to art. What George Washington did for us was to throw out the British, so that we wouldn't have a fat, insensitive government running our country. Nice try anyway, George. - -- D.J. on KSFO/KYA + -- D. J. on KSFO/KYA % What good is a ticket to the good life, if you can't find the entrance? @@ -15193,7 +15192,7 @@ When you are in it up to your ears, keep your mouth shut. When you don't know what you are doing, do it neatly. % When you have an efficient government, you have a dictatorship. - -- Harry Truman + -- Harry S. Truman % When you have shot and killed a man you have in some measure clarified your attitude toward him. You have given a definite answer @@ -15410,7 +15409,7 @@ Why You Can't Run When There's Trouble in the Office: No matter where you stand, no matter how far or fast you flee, when it hits the fan, as much as possible will be propelled in your direction, and almost none will be returned to the source. - -- John L. Shelton + -- John L. Shelton % Wiker's Law: Government expands to absorb revenue and then some. @@ -15452,7 +15451,7 @@ try to be a fraud and a half. -- Otto von Bismark % With a rubber duck, one's never alone. - -- "The Hitchhiker's Guide to the Galaxy" + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % With all the fancy scientists in the world, why can't they just once build a nuclear balm? @@ -15877,7 +15876,7 @@ deep space that I really wish I'd listened to what my mother told me when I was young!" "Why, what did she tell you?" "I don't know, I didn't listen!" - -- Douglas Adams, "Hitchhiker's Guide to the Galaxy" + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % You look like a million dollars. All green and wrinkled. % @@ -15929,7 +15928,7 @@ You possess a mind not merely twisted, but actually sprained. % You probably wouldn't worry about what people think of you if you could know how seldom they do. - -- Olin Miller. + -- Olin Miller % You should emulate your heros, but don't carry it too far. Especially if they are dead. diff --git a/fortune/datfiles/fortunes.sp.ok b/fortune/datfiles/fortunes.sp.ok index 4161ae8..0e4da00 100644 --- a/fortune/datfiles/fortunes.sp.ok +++ b/fortune/datfiles/fortunes.sp.ok @@ -176,7 +176,6 @@ CONGRAM CONtractor CPPR CPU -CPU's CPUs CRN CS @@ -1387,8 +1386,6 @@ conks copacetic corkenpoppen corpuscle -cpu -cpu's crabgrass crapshoot criminology diff --git a/fortune/datfiles/fortunes2 b/fortune/datfiles/fortunes2 index f2629a8..6efeb9a 100644 --- a/fortune/datfiles/fortunes2 +++ b/fortune/datfiles/fortunes2 @@ -20276,9 +20276,9 @@ Hideously disfigured by an ancient Indian curse? Call (511) 338-0959 for an immediate appointment. % -Hier liegt ein Mann ganz obnegleich; -Im Leibe dick, an Suden reich. -Wir haben ihn in das Grab gesteckt, Here lies a man with sundry flaws +Hier liegt ein Mann ganz ohnegleich; +Im Leibe dick, an Suenden reich. +Wir haben ihn ins Grab gesteckt, Here lies a man with sundry flaws Weil es uns dunkt er sei verreckt. And numerous Sins upon his head; We buried him today because As far as we can tell, he's dead. @@ -30870,7 +30870,7 @@ MEETINGS: % Meetings are an addictive, highly self indulgent activity that corporations and other large organizations habitually engage -in only becuase they cannot actually masturbate. +in only because they cannot actually masturbate. -- Dave Barry % MEMO: @@ -36197,7 +36197,7 @@ SAMPLE: Proof of induction without proof of induction. for every natural number less than n. N is arbitrary, so we can take n as large as we want. If n is sufficiently large, the case of n+1 is trivially equivalent, so the only important n are n less than n. We can -take n = n (from above), so it's true for n+1 becuase it's just about n. +take n = n (from above), so it's true for n+1 because it's just about n. QED. (QED translates from the Latin as "So what?") % Proof techniques #2: Proof by Oddity. @@ -42099,7 +42099,7 @@ utterly absurd; indeed, in view of the silliness of the majority of mankind, a widespread belief is more often likely to be foolish than sensible. -- Bertrand Russell, in "Marriage and Morals", 1929 % -The fact that hitler was a politcal genius unmasks the nature of politics +The fact that Hitler was a political genius unmasks the nature of politics in general as no other can. -- Wilhelm Reich % diff --git a/fortune/datfiles/fortunes2-o.real b/fortune/datfiles/fortunes2-o.real index efa5076..37a180a 100644 --- a/fortune/datfiles/fortunes2-o.real +++ b/fortune/datfiles/fortunes2-o.real @@ -8483,7 +8483,7 @@ you lose interest. -- Professor Irwin Corey % Mary had a little lamb, -It's fleece as white as snow. +Its fleece as white as snow. It followed her to school one day, And got fucked by a big black dog. % diff --git a/fortune/fortune/.cvsignore b/fortune/fortune/.cvsignore deleted file mode 100644 index 56928ff..0000000 --- a/fortune/fortune/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -fortune -pathnames.h -fortune.6 diff --git a/fortune/fortune/fortune.6.in b/fortune/fortune/fortune.6.in index d46b9e3..81f0cca 100644 --- a/fortune/fortune/fortune.6.in +++ b/fortune/fortune/fortune.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: fortune.6,v 1.10 2003/08/07 09:37:13 agc Exp $ +.\" $NetBSD: fortune.6,v 1.11 2004/09/09 22:01:08 wiz Exp $ .\" .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -32,7 +32,7 @@ .\" .\" @(#)fortune.6 8.3 (Berkeley) 4/19/94 .\" -.Dd April 19, 1994 +.Dd September 9, 2004 .Dt FORTUNE 6 .Os .Sh NAME @@ -66,9 +66,13 @@ on multiple files). .It Fl f Print out the list of files which would be searched, but don't print a fortune. +.It Fl i +Ignore case for +.Fl m +patterns. .It Fl l Long dictums only. -.It Fl m +.It Fl m Ar pattern Print out all fortunes which match the regular expression .Ar pattern . See @@ -96,10 +100,6 @@ Needs be. .Ed .It Fl s Short apothegms only. -.It Fl i -Ignore case for -.Fl m -patterns. .It Fl w Wait before termination for an amount of time calculated from the number of characters in the message. @@ -110,13 +110,14 @@ to guarantee that the message can be read before the screen is cleared. The user may specify alternative sayings. You can specify a specific file, a directory which contains one or more files, or the special word -.Em all +.Em all , which says to use all the standard databases. Any of these may be preceded by a percentage, which is a number .Ar N between 0 and 100 inclusive, followed by a -.Ar % . -If it is, there will be a +.Sq % +character. +If it is, there will be an .Ar N percent probability that an adage will be picked from that file or directory. @@ -133,7 +134,7 @@ with .Em funny twice as big, saying .Bd -literal -offset indent -fortune funny not-funny +$ fortune funny not-funny .Ed .Pp will get you fortunes out of @@ -141,27 +142,41 @@ will get you fortunes out of two-thirds of the time. The command .Bd -literal -offset indent -fortune 90% funny 10% not-funny +$ fortune 90% funny 10% not-funny .Ed .Pp will pick out 90% of its fortunes from .Em funny -(the ``10% not-funny'' is unnecessary, since 10% is all that's left). +(the +.Dq 10% +is unnecessary, since 10% is all that's left). The .Fl e option says to consider all files equal; thus .Bd -literal -offset indent -fortune -e +$ fortune -e .Ed .Pp is equivalent to .Bd -literal -offset indent -fortune 50% funny 50% not -.Em -funny +$ fortune 50% funny 50% not-funny .Ed +.Pp +Datafiles for +.Nm +are created by the +.Xr strfile 8 +utility, which is not installed by default, +The source code for this utility +can on BSD systems be found in +.Pa /usr/src/games/fortune/strfile , +if it exists. .Sh FILES -.Bl -tag -width Pa -compact -.It Pa @fortune_dir@ +.Bl -tag -width XX@fortune_dir@/*XX -compact +.It Pa @fortune_dir@/* +Fortune files. .El .Sh SEE ALSO -.Xr regex 3 +.Xr regex 3 , +.Xr random 6 , +.Xr rot13 6 diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c index abe7321..e1b4b95 100644 --- a/fortune/fortune/fortune.c +++ b/fortune/fortune/fortune.c @@ -1,4 +1,4 @@ -/* $NetBSD: fortune.c,v 1.43 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: fortune.c,v 1.44 2004/11/05 21:30:32 dsl Exp $ */ /*- * Copyright (c) 1986, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\ #if 0 static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: fortune.c,v 1.43 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: fortune.c,v 1.44 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -287,9 +287,9 @@ rot13(line, len) len = strlen(line); for (p = line; (ch = *p) != 0; ++p) - if (isupper(ch)) + if (isupper((unsigned char)ch)) *p = 'A' + (ch - 'A' + 13) % 26; - else if (islower(ch)) + else if (islower((unsigned char)ch)) *p = 'a' + (ch - 'a' + 13) % 26; } @@ -458,11 +458,11 @@ form_file_list(files, file_cnt) } for (i = 0; i < file_cnt; i++) { percent = NO_PROB; - if (!isdigit(files[i][0])) + if (!isdigit((unsigned char)files[i][0])) sp = files[i]; else { percent = 0; - for (sp = files[i]; isdigit(*sp); sp++) + for (sp = files[i]; isdigit((unsigned char)*sp); sp++) percent = percent * 10 + *sp - '0'; if (percent > 100) { warnx("Percentages must be <= 100"); @@ -1273,7 +1273,7 @@ conv_pat(orig) cnt = 1; /* allow for '\0' */ for (sp = orig; *sp != '\0'; sp++) - if (isalpha(*sp)) + if (isalpha((unsigned char)*sp)) cnt += 4; else cnt++; @@ -1281,16 +1281,16 @@ conv_pat(orig) err(1, NULL); for (sp = new; *orig != '\0'; orig++) { - if (islower(*orig)) { + if (islower((unsigned char)*orig)) { *sp++ = '['; *sp++ = *orig; - *sp++ = toupper(*orig); + *sp++ = toupper((unsigned char)*orig); *sp++ = ']'; } - else if (isupper(*orig)) { + else if (isupper((unsigned char)*orig)) { *sp++ = '['; *sp++ = *orig; - *sp++ = tolower(*orig); + *sp++ = tolower((unsigned char)*orig); *sp++ = ']'; } else diff --git a/fortune/strfile/.cvsignore b/fortune/strfile/.cvsignore deleted file mode 100644 index 301f822..0000000 --- a/fortune/strfile/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -strfile diff --git a/fortune/strfile/strfile.8 b/fortune/strfile/strfile.8 index 0ea3160..8145493 100644 --- a/fortune/strfile/strfile.8 +++ b/fortune/strfile/strfile.8 @@ -1,8 +1,8 @@ -.\" $NetBSD: strfile.8,v 1.11 2003/08/07 09:37:14 agc Exp $ +.\" $NetBSD: strfile.8,v 1.12 2004/09/09 22:03:21 wiz Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. -.\" +.\" .\" This code is derived from software contributed to Berkeley by .\" Ken Arnold. .\" @@ -97,7 +97,7 @@ field to be set. .El .Pp The format of the header is: -.Bd -literal +.Bd -literal -offset indent #define VERSION 1 unsigned long str_version; /* version number */ unsigned long str_numstr; /* # of strings in the file */ @@ -128,14 +128,14 @@ when is run and then using .Nm unstr to dump them out in the table order. -.Sh SEE ALSO -.Xr byteorder 3 , -.Xr fortune 6 .Sh FILES .Bl -tag -width strfile.out -compact .It Pa strfile.out default output file. .El +.Sh SEE ALSO +.Xr byteorder 3 , +.Xr fortune 6 .Sh HISTORY The .Nm strfile diff --git a/fortune/unstr/.cvsignore b/fortune/unstr/.cvsignore deleted file mode 100644 index 78ef533..0000000 --- a/fortune/unstr/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -unstr diff --git a/gomoku/.cvsignore b/gomoku/.cvsignore deleted file mode 100644 index 100ee17..0000000 --- a/gomoku/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -gomoku diff --git a/gomoku/stoc.c b/gomoku/stoc.c index 16488e6..9ca5e65 100644 --- a/gomoku/stoc.c +++ b/gomoku/stoc.c @@ -1,4 +1,4 @@ -/* $NetBSD: stoc.c,v 1.7 2003/08/07 09:37:18 agc Exp $ */ +/* $NetBSD: stoc.c,v 1.8 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1994 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)stoc.c 8.1 (Berkeley) 7/24/94"; #else -__RCSID("$NetBSD: stoc.c,v 1.7 2003/08/07 09:37:18 agc Exp $"); +__RCSID("$NetBSD: stoc.c,v 1.8 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -88,7 +88,7 @@ ctos(mp) for (i = 0; mv[i].m_code >= 0; i++) if (strcmp(mp, mv[i].m_text) == 0) return(mv[i].m_code); - if (!isalpha(mp[0])) + if (!isalpha((unsigned char)mp[0])) return(ILLEGAL); i = atoi(&mp[1]); if (i < 1 || i > 19) diff --git a/hack/.cvsignore b/hack/.cvsignore deleted file mode 100644 index 282c0f3..0000000 --- a/hack/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -hack -makedefs -pathnames.h -hack.6 -hack.onames.h diff --git a/hack/data b/hack/data index 5d8d509..4190205 100644 --- a/hack/data +++ b/hack/data @@ -146,7 +146,7 @@ c a cockatrice; gle glance from its yellow, piercing toad's eyes will kill both man and beast. Its power of destruction is said to be so great that sometimes simply to hear its hiss can prove - fatal. Its breath is so venomenous that it causes all vege- + fatal. Its breath is so venomous that it causes all vege- tation to wither. There is, however, one creature which can withstand the basilisk's deadly gaze, and this is the weasel. No one knows diff --git a/hack/hack.6.in b/hack/hack.6.in index f83de1b..4c3d98a 100644 --- a/hack/hack.6.in +++ b/hack/hack.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: hack.6,v 1.13 2003/06/27 22:48:35 wiz Exp $ -*- nroff -*- +.\" $NetBSD: hack.6,v 1.14 2004/06/01 10:10:06 wiz Exp $ -*- nroff -*- .\" .\" Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, .\" Amsterdam @@ -88,7 +88,7 @@ will give you a list of the available commands and the command .Ic / will identify the things you see on the screen. .Pp -To win the game (as opposed to merely playing to beat other people high +To win the game (as opposed to merely playing to beat other people's high scores) you must locate the Amulet of Yendor which is somewhere below the 20th level of the dungeon and get it out. Nobody has achieved this yet and if somebody does, he will probably go diff --git a/hack/hack.termcap.c b/hack/hack.termcap.c index 2af3c75..748fc34 100644 --- a/hack/hack.termcap.c +++ b/hack/hack.termcap.c @@ -77,10 +77,10 @@ __RCSID("$NetBSD: hack.termcap.c,v 1.12 2003/04/02 18:36:40 jsm Exp $"); #include "def.flag.h" /* for flags.nonull */ static char tbuf[512]; -char *HO, *CL, *CE, *UP, *CM, *ND, *XD, *BC, *SO, *SE, *TI, *TE; +char *HO, *CL, *CE, *UP, *CM, *ND, *XD, *BC, *SO, *SE, *TI, *TE; static char *VS, *VE; static int SG; -char PC = '\0'; +char PC = '\0'; char *CD; /* tested in pri.c: docorner() */ int CO, LI; /* used in pri.c and whatis.c */ diff --git a/hack/hack.u_init.c b/hack/hack.u_init.c index 97246c6..9b11102 100644 --- a/hack/hack.u_init.c +++ b/hack/hack.u_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.u_init.c,v 1.7 2003/04/02 18:36:41 jsm Exp $ */ +/* $NetBSD: hack.u_init.c,v 1.8 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.u_init.c,v 1.7 2003/04/02 18:36:41 jsm Exp $"); +__RCSID("$NetBSD: hack.u_init.c,v 1.8 2004/11/05 21:30:32 dsl Exp $"); #endif /* not lint */ #include @@ -169,8 +169,8 @@ u_init() rolesyms[i] = 0; if ((pc = pl_character[0]) != '\0') { - if (islower(pc)) - pc = toupper(pc); + if (islower((unsigned char)pc)) + pc = toupper((unsigned char)pc); if ((i = role_index(pc)) >= 0) goto got_suffix; /* implies experienced */ printf("\nUnknown role: %c\n", pc); @@ -201,8 +201,8 @@ u_init() printf("? [%s] ", rolesyms); while ((pc = readchar()) != '\0') { - if (islower(pc)) - pc = toupper(pc); + if (islower((unsigned char)pc)) + pc = toupper((unsigned char)pc); if ((i = role_index(pc)) >= 0) { printf("%c\n", pc); /* echo */ (void) fflush(stdout); /* should be seen */ diff --git a/hack/rumors b/hack/rumors index 9435a5f..39c6cc9 100644 --- a/hack/rumors +++ b/hack/rumors @@ -191,7 +191,7 @@ If you can't learn to do it well, learn to enjoy doing it badly. If you need a wand of digging, kindly ask the minotaur. If you see nurses you better start looking somewhere for a doctor. If you turn blind: don't expect your dog to be turned into a seeing-eye dog. -If you want to feal great, you must eat something real big. +If you want to feel great, you must eat something real big. If you want to float you'd better eat a floating eye. If you want to genocide nurses, genocide @'s. If you want to hit, use a dagger. diff --git a/hangman/.cvsignore b/hangman/.cvsignore deleted file mode 100644 index 9e75547..0000000 --- a/hangman/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -hangman -pathnames.h -hangman.6 diff --git a/hangman/getword.c b/hangman/getword.c index 8d8cc72..1b5396a 100644 --- a/hangman/getword.c +++ b/hangman/getword.c @@ -1,4 +1,4 @@ -/* $NetBSD: getword.c,v 1.8 2003/08/07 09:37:21 agc Exp $ */ +/* $NetBSD: getword.c,v 1.9 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getword.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getword.c,v 1.8 2003/08/07 09:37:21 agc Exp $"); +__RCSID("$NetBSD: getword.c,v 1.9 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -63,7 +63,7 @@ getword() if (strlen(Word) < Minlen) continue; for (wp = Word; *wp; wp++) - if (!islower(*wp)) + if (!islower((unsigned char)*wp)) goto cont; break; cont: ; diff --git a/hunt/hunt/.cvsignore b/hunt/hunt/.cvsignore deleted file mode 100644 index 0b52286..0000000 --- a/hunt/hunt/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -hunt -hunt.6 diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c index a094dd9..28321bc 100644 --- a/hunt/hunt/hunt.c +++ b/hunt/hunt/hunt.c @@ -1,4 +1,4 @@ -/* $NetBSD: hunt.c,v 1.22 2004/02/08 22:23:50 jsm Exp $ */ +/* $NetBSD: hunt.c,v 1.23 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hunt.c,v 1.22 2004/02/08 22:23:50 jsm Exp $"); +__RCSID("$NetBSD: hunt.c,v 1.23 2004/11/05 21:30:32 dsl Exp $"); #endif /* not lint */ # include @@ -149,7 +149,7 @@ main(ac, av) break; case 't': team = *optarg; - if (!isdigit(team)) { + if (!isdigit((unsigned char)team)) { warnx("Team names must be numeric"); team = ' '; } @@ -1065,7 +1065,7 @@ env_init(enter_status) # endif else if (strncmp(envp, "team=", s - envp + 1) == 0) { team = *(s + 1); - if (!isdigit(team)) + if (!isdigit((unsigned char)team)) team = ' '; if ((s = strchr(envp, ',')) == NULL) { *envp = '\0'; @@ -1128,7 +1128,7 @@ again: goto again; } for (cp = name; *cp != '\0'; cp++) - if (!isprint(*cp)) { + if (!isprint((unsigned char)*cp)) { name[0] = '\0'; printf("Illegal character in your code name.\n"); goto again; diff --git a/hunt/hunt/otto.c b/hunt/hunt/otto.c index 3fcaaee..a2c97e0 100644 --- a/hunt/hunt/otto.c +++ b/hunt/hunt/otto.c @@ -1,4 +1,4 @@ -/* $NetBSD: otto.c,v 1.7 2004/02/08 22:23:50 jsm Exp $ */ +/* $NetBSD: otto.c,v 1.8 2004/11/05 21:30:32 dsl Exp $ */ # ifdef OTTO /* * Copyright (c) 1983-2003, Regents of the University of California. @@ -45,7 +45,7 @@ #include #ifndef lint -__RCSID("$NetBSD: otto.c,v 1.7 2004/02/08 22:23:50 jsm Exp $"); +__RCSID("$NetBSD: otto.c,v 1.8 2004/11/05 21:30:32 dsl Exp $"); #endif /* not lint */ # include @@ -438,7 +438,7 @@ face_and_move_direction(rel_dir, distance) int i; struct item items[NUMDIRECTIONS]; - command[comlen++] = toupper(cmd); + command[comlen++] = toupper((unsigned char)cmd); if (distance == 0) { /* rotate ottolook's to be in right position */ for (i = 0; i < NUMDIRECTIONS; i++) diff --git a/hunt/huntd/.cvsignore b/hunt/huntd/.cvsignore deleted file mode 100644 index 00cccf2..0000000 --- a/hunt/huntd/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -huntd -huntd.6 diff --git a/hunt/huntd/answer.c b/hunt/huntd/answer.c index d4dc6e7..828e3e7 100644 --- a/hunt/huntd/answer.c +++ b/hunt/huntd/answer.c @@ -1,4 +1,4 @@ -/* $NetBSD: answer.c,v 1.6 2003/06/11 12:00:22 wiz Exp $ */ +/* $NetBSD: answer.c,v 1.7 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: answer.c,v 1.6 2003/06/11 12:00:22 wiz Exp $"); +__RCSID("$NetBSD: answer.c,v 1.7 2004/11/05 21:30:32 dsl Exp $"); #endif /* not lint */ # include @@ -116,7 +116,7 @@ answer() * between driver and player processes */ for (cp1 = cp2 = name; *cp1 != '\0'; cp1++) - if (isprint(*cp1) || *cp1 == ' ') + if (isprint((unsigned char)*cp1) || *cp1 == ' ') *cp2++ = *cp1; *cp2 = '\0'; diff --git a/include/.cvsignore b/include/.cvsignore deleted file mode 100644 index 37ddc18..0000000 --- a/include/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bsd-games.h diff --git a/lib/.cvsignore b/lib/.cvsignore deleted file mode 100644 index 84a962b..0000000 --- a/lib/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp diff --git a/lib/fgetln.c b/lib/fgetln.c index fb5e061..d05c416 100644 --- a/lib/fgetln.c +++ b/lib/fgetln.c @@ -1,6 +1,6 @@ /* lib/fgetln.c - bsd-games implementation of fgetln. * - * Copyright (c) 1997, 1998, 1999, 2000 Joseph Samuel Myers. + * Copyright (c) 1997, 1998, 1999, 2000, 2004 Joseph Samuel Myers. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ fgetln(FILE *stream, size_t *len) res = fgets(buf, buflen, stream); if (res == NULL) return NULL; - while (buf[buflen - 1] == 0) { /* long line */ + while (buf[buflen - 1] == 0 && buf[buflen - 2] != '\n') { /* long line */ nbuf = realloc(buf, buflen * 2); if (nbuf == NULL) return NULL; diff --git a/mille/.cvsignore b/mille/.cvsignore deleted file mode 100644 index 92d1bff..0000000 --- a/mille/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -mille diff --git a/mille/move.c b/mille/move.c index 1cfa7a0..e383e9c 100644 --- a/mille/move.c +++ b/mille/move.c @@ -1,4 +1,4 @@ -/* $NetBSD: move.c,v 1.13 2003/08/07 09:37:25 agc Exp $ */ +/* $NetBSD: move.c,v 1.15 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,12 +34,16 @@ #if 0 static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: move.c,v 1.13 2003/08/07 09:37:25 agc Exp $"); +__RCSID("$NetBSD: move.c,v 1.15 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ #include +#ifdef DEBUG +#include +#endif + #include "mille.h" #ifndef unctrl #include "unctrl.h" @@ -60,6 +64,13 @@ domove() bool goodplay; pp = &Player[Play]; + for (i = 0, j = 0; i < HAND_SZ; i++) + if (pp->hand[i] != -1) + j++; + if (!j) { + nextplay(); + return; + } if (Play == PLAYER) getmove(); else @@ -356,9 +367,9 @@ getmove() refresh(); while ((c = readch()) == killchar() || c == erasechar()) continue; - if (islower(c)) - c = toupper(c); - if (isprint(c) && !isspace(c)) { + if (islower((unsigned char)c)) + c = toupper((unsigned char)c); + if (isprint((unsigned char)c) && !isspace((unsigned char)c)) { addch(c); refresh(); } @@ -426,10 +437,12 @@ getmove() case 'Z': /* Debug code */ if (!Debug && outf == NULL) { char buf[MAXPATHLEN]; + char *sp; prompt(FILEPROMPT); leaveok(Board, FALSE); refresh(); +over: sp = buf; while ((*sp = readch()) != '\n') { if (*sp == killchar()) diff --git a/monop/.cvsignore b/monop/.cvsignore deleted file mode 100644 index 3fb93ea..0000000 --- a/monop/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -monop -initdeck -pathnames.h -monop.6 -cards.pck diff --git a/monop/getinp.c b/monop/getinp.c index 3fb739b..fee84c5 100644 --- a/monop/getinp.c +++ b/monop/getinp.c @@ -1,4 +1,4 @@ -/* $NetBSD: getinp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: getinp.c,v 1.13 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getinp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: getinp.c,v 1.13 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -91,8 +91,7 @@ inter: } *sp = '\0'; for (sp = buf; *sp; sp++) - if (isupper(*sp)) - *sp = tolower(*sp); + *sp = tolower((unsigned char)*sp); for (i = n_match = 0; list[i]; i++) if (comp(list[i])) { n_match++; @@ -115,7 +114,7 @@ comp(s1) if (buf[0] != '\0') for (sp = buf, tsp = s1; *sp; ) { - c = isupper(*tsp) ? tolower(*tsp) : *tsp; + c = tolower((unsigned char)*tsp); tsp++; if (c != *sp++) return 0; diff --git a/monop/malloc.c b/monop/malloc.c index f5b0239..5e171af 100644 --- a/monop/malloc.c +++ b/monop/malloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: malloc.c,v 1.3 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: malloc.c,v 1.4 2004/12/14 00:21:01 nathanw Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)malloc.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: malloc.c,v 1.3 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: malloc.c,v 1.4 2004/12/14 00:21:01 nathanw Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -59,7 +59,7 @@ __RCSID("$NetBSD: malloc.c,v 1.3 2004/01/27 20:30:30 jsm Exp $"); #include #include #include -#include +#include /* @@ -118,7 +118,7 @@ static int pagebucket; /* page size bucket */ static u_int nmalloc[NBUCKETS]; #endif -static mutex_t malloc_mutex = MUTEX_INITIALIZER; +static pthread_mutex_t malloc_mutex = PTHREAD_MUTEX_INITIALIZER; static void morecore(int); static int findbucket(union overhead *, int); @@ -176,7 +176,7 @@ malloc(nbytes) long n; unsigned amt; - mutex_lock(&malloc_mutex); + pthread_mutex_lock(&malloc_mutex); /* * First time malloc is called, setup page size and @@ -191,7 +191,7 @@ malloc(nbytes) n += pagesz; if (n) { if (sbrk((int)n) == (void *)-1) { - mutex_unlock(&malloc_mutex); + pthread_mutex_unlock(&malloc_mutex); return (NULL); } } @@ -234,7 +234,7 @@ malloc(nbytes) if ((op = nextf[bucket]) == NULL) { morecore(bucket); if ((op = nextf[bucket]) == NULL) { - mutex_unlock(&malloc_mutex); + pthread_mutex_unlock(&malloc_mutex); return (NULL); } } @@ -245,7 +245,7 @@ malloc(nbytes) #ifdef MSTATS nmalloc[bucket]++; #endif - mutex_unlock(&malloc_mutex); + pthread_mutex_unlock(&malloc_mutex); #ifdef RCHECK /* * Record allocated size of block and @@ -326,13 +326,13 @@ free(cp) #endif size = op->ov_index; ASSERT(size < NBUCKETS); - mutex_lock(&malloc_mutex); + pthread_mutex_lock(&malloc_mutex); op->ov_next = nextf[(unsigned int)size];/* also clobbers ov_magic */ nextf[(unsigned int)size] = op; #ifdef MSTATS nmalloc[(size_t)size]--; #endif - mutex_unlock(&malloc_mutex); + pthread_mutex_unlock(&malloc_mutex); } /* @@ -366,7 +366,7 @@ realloc(cp, nbytes) return (NULL); } op = (union overhead *)(void *)((caddr_t)cp - sizeof (union overhead)); - mutex_lock(&malloc_mutex); + pthread_mutex_lock(&malloc_mutex); if (op->ov_magic == MAGIC) { was_alloced++; i = op->ov_index; @@ -408,7 +408,7 @@ realloc(cp, nbytes) op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; #endif - mutex_unlock(&malloc_mutex); + pthread_mutex_unlock(&malloc_mutex); return (cp); } @@ -417,7 +417,7 @@ realloc(cp, nbytes) free(cp); #endif } - mutex_unlock(&malloc_mutex); + pthread_mutex_unlock(&malloc_mutex); if ((res = malloc(nbytes)) == NULL) { #ifdef _REENT free(cp); diff --git a/monop/misc.c b/monop/misc.c index f9a3755..1d3a566 100644 --- a/monop/misc.c +++ b/monop/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $ */ +/* $NetBSD: misc.c,v 1.13 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $"); +__RCSID("$NetBSD: misc.c,v 1.13 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -109,9 +109,9 @@ inter: *sp = c; if (sp == buf) continue; - for (sp = buf; isspace(*sp); sp++) + for (sp = buf; isspace((unsigned char)*sp); sp++) continue; - for (; isdigit(*sp); sp++) + for (; isdigit((unsigned char)*sp); sp++) num = num * 10 + *sp - '0'; if (*sp == '\n') return num; diff --git a/morse/.cvsignore b/morse/.cvsignore deleted file mode 100644 index 34840ee..0000000 --- a/morse/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -morse diff --git a/number/.cvsignore b/number/.cvsignore deleted file mode 100644 index d0f7c8f..0000000 --- a/number/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -number diff --git a/number/number.c b/number/number.c index f83d56d..c7559e1 100644 --- a/number/number.c +++ b/number/number.c @@ -1,4 +1,4 @@ -/* $NetBSD: number.c,v 1.9 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: number.c,v 1.10 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1988, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: number.c,v 1.9 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: number.c,v 1.10 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -144,7 +144,7 @@ convert(line) } goto badnum; } - if (isdigit(*p)) + if (isdigit((unsigned char)*p)) continue; switch (*p) { case '.': diff --git a/phantasia/.cvsignore b/phantasia/.cvsignore deleted file mode 100644 index ffa5cf6..0000000 --- a/phantasia/.cvsignore +++ /dev/null @@ -1,17 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -phantasia -setup -pathnames.h -gold -lastdead -mess -monsters -motd -void -scoreboard -characs -scorefiles.stamp diff --git a/phantasia/fight.c b/phantasia/fight.c index a44b4d1..cb44682 100644 --- a/phantasia/fight.c +++ b/phantasia/fight.c @@ -1,10 +1,12 @@ -/* $NetBSD: fight.c,v 1.8 2004/02/08 00:32:07 jsm Exp $ */ +/* $NetBSD: fight.c,v 1.10 2004/04/11 13:35:06 he Exp $ */ /* * fight.c Phantasia monster fighting routines */ #include "include.h" +#undef bool +#include void encounter(particular) diff --git a/phantasia/gamesupport.c b/phantasia/gamesupport.c index 6c6d804..2bfc67f 100644 --- a/phantasia/gamesupport.c +++ b/phantasia/gamesupport.c @@ -1,14 +1,16 @@ -/* $NetBSD: gamesupport.c,v 1.6 1999/09/08 21:57:19 jsm Exp $ */ +/* $NetBSD: gamesupport.c,v 1.9 2005/02/15 12:58:21 jsm Exp $ */ /* * gamesupport.c - auxiliary routines for support of Phantasia */ #include "include.h" +#undef bool +#include void changestats(ingameflag) - bool ingameflag; + phbool ingameflag; { static char flag[2] = /* for printing values of bools */ {'F', 'T'}; @@ -20,7 +22,7 @@ changestats(ingameflag) long loc; /* location in player file */ time_t now; /* time now */ double dtemp; /* temporary variable */ - bool *bptr; /* pointer to bool item to change */ + phbool *bptr; /* pointer to bool item to change */ double *dptr; /* pointer to double item to change */ short *sptr; /* pointer to short item to change */ diff --git a/phantasia/include.h b/phantasia/include.h index 4b982a4..e54c5c4 100644 --- a/phantasia/include.h +++ b/phantasia/include.h @@ -1,15 +1,15 @@ -/* $NetBSD: include.h,v 1.4 1997/10/13 02:18:19 lukem Exp $ */ +/* $NetBSD: include.h,v 1.5 2004/04/07 17:46:47 ross Exp $ */ /* * include.h - includes all important files for Phantasia */ #include -#include #include #include #include #include +#include #include #include #include diff --git a/phantasia/interplayer.c b/phantasia/interplayer.c index 993c162..3cb786c 100644 --- a/phantasia/interplayer.c +++ b/phantasia/interplayer.c @@ -1,10 +1,12 @@ -/* $NetBSD: interplayer.c,v 1.6 1999/09/18 19:38:52 jsm Exp $ */ +/* $NetBSD: interplayer.c,v 1.9 2005/02/15 12:58:21 jsm Exp $ */ /* * interplayer.c - player to player routines for Phantasia */ #include "include.h" +#undef bool +#include void checkbattle() @@ -537,7 +539,7 @@ tampered(what, arg1, arg2) void userlist(ingameflag) - bool ingameflag; + phbool ingameflag; { int numusers = 0; /* number of users on file */ diff --git a/phantasia/io.c b/phantasia/io.c index 5a4c009..66f2363 100644 --- a/phantasia/io.c +++ b/phantasia/io.c @@ -1,10 +1,12 @@ -/* $NetBSD: io.c,v 1.6 2004/02/08 00:32:07 jsm Exp $ */ +/* $NetBSD: io.c,v 1.9 2005/02/15 12:58:21 jsm Exp $ */ /* * io.c - input/output routines for Phantasia */ #include "include.h" +#undef bool +#include void getstring(cp, mx) @@ -154,7 +156,7 @@ interrupt() int getanswer(choices, def) const char *choices; - bool def; + phbool def; { int ch; /* input */ volatile int loop; /* counter */ diff --git a/phantasia/main.c b/phantasia/main.c index 230fd0d..c370293 100644 --- a/phantasia/main.c +++ b/phantasia/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.12 2004/01/01 16:03:46 jsm Exp $ */ +/* $NetBSD: main.c,v 1.15 2004/12/09 05:15:59 jmc Exp $ */ /* * Phantasia 3.3.2 -- Interterminal fantasy game @@ -27,6 +27,7 @@ * AT&T is in no way connected with this game. */ +#include #include #include #include @@ -57,6 +58,8 @@ */ #include "include.h" +#undef bool +#include int main(int, char **); @@ -270,6 +273,8 @@ main(argc, argv) void initialstate() { + struct stat sb; + Beyond = FALSE; Marsh = FALSE; Throne = FALSE; @@ -301,6 +306,16 @@ initialstate() if ((Energyvoidfp = fopen(_PATH_VOID, "r+")) == NULL) error(_PATH_VOID); + if (fstat(fileno(Energyvoidfp), &sb) == -1) + error("stat"); + if (sb.st_size == 0) { + /* initialize grail to new location */ + Enrgyvoid.ev_active = TRUE; + Enrgyvoid.ev_x = ROLL(-1.0e6, 2.0e6); + Enrgyvoid.ev_y = ROLL(-1.0e6, 2.0e6); + writevoid(&Enrgyvoid, 0L); + } + /* NOTREACHED */ srandom((unsigned) time(NULL)); /* prime random numbers */ diff --git a/phantasia/misc.c b/phantasia/misc.c index 4dc71b3..d3f72b9 100644 --- a/phantasia/misc.c +++ b/phantasia/misc.c @@ -1,10 +1,12 @@ -/* $NetBSD: misc.c,v 1.10 2004/01/01 16:03:46 jsm Exp $ */ +/* $NetBSD: misc.c,v 1.14 2005/02/15 12:58:21 jsm Exp $ */ /* * misc.c Phantasia miscellaneous support routines */ #include "include.h" +#undef bool +#include void @@ -63,7 +65,7 @@ movelevel() const char * descrlocation(playerp, shortflag) struct player *playerp; - bool shortflag; + phbool shortflag; { double circle; /* corresponding circle for coordinates */ int quadrant; /* quandrant of grid */ @@ -445,7 +447,7 @@ allstatslist() const char * descrtype(playerp, shortflag) struct player *playerp; - bool shortflag; + phbool shortflag; { int type; /* for caluculating result subscript */ static const char *const results[] =/* description table */ @@ -671,7 +673,7 @@ death(how) if (ch == 'Y') { cleanup(FALSE); execl(_PATH_GAMEPROG, "phantasia", "-s", - (Wizard ? "-S" : (char *) NULL), 0); + (Wizard ? "-S" : (char *) NULL), (char *) NULL); exit(0); /* NOTREACHED */ } diff --git a/phantasia/phantstruct.h b/phantasia/phantstruct.h index 948bb23..fef673f 100644 --- a/phantasia/phantstruct.h +++ b/phantasia/phantstruct.h @@ -1,4 +1,8 @@ -/* $NetBSD: phantstruct.h,v 1.3 1999/09/08 21:17:55 jsm Exp $ */ +/* $NetBSD: phantstruct.h,v 1.5 2005/02/15 12:58:21 jsm Exp $ */ + +#define bool char +/* phbool is used when we need this version of bool after . */ +#define phbool char /* * phantstruct.h - structure definitions for Phantasia diff --git a/phantasia/setup.c b/phantasia/setup.c index 029e9b6..ea0aafa 100644 --- a/phantasia/setup.c +++ b/phantasia/setup.c @@ -1,4 +1,4 @@ -/* $NetBSD: setup.c,v 1.12 2003/05/08 13:03:49 wiz Exp $ */ +/* $NetBSD: setup.c,v 1.14 2004/12/09 05:15:59 jmc Exp $ */ /* * setup.c - set up all files for Phantasia @@ -109,21 +109,10 @@ main(argc, argv) ++filename; /* process next file */ } - /* put holy grail info into energy void file */ - Enrgyvoid.ev_active = TRUE; - Enrgyvoid.ev_x = ROLL(-1.0e6, 2.0e6); - Enrgyvoid.ev_y = ROLL(-1.0e6, 2.0e6); - path = strrchr(_PATH_VOID, '/') + 1; + /* Initialize an empty file placeholder for the grail location. */ if ((fp = fopen(path, "w")) == NULL) - Error("Cannot update %s.\n", path); - else - { - fwrite(&Enrgyvoid, SZ_VOIDSTRUCT, 1, fp); - fflush(fp); - if (ferror(fp)) - Error("Writing %s.\n", path); - fclose(fp); - } + Error("Cannot create %s.\n", path); + fclose(fp); /* create binary monster data base */ path = strrchr(_PATH_MONST, '/') + 1; diff --git a/pig/.cvsignore b/pig/.cvsignore deleted file mode 100644 index 7a298f0..0000000 --- a/pig/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -pig diff --git a/pig/pig.c b/pig/pig.c index 7d79ca3..2b41edd 100644 --- a/pig/pig.c +++ b/pig/pig.c @@ -1,4 +1,4 @@ -/* $NetBSD: pig.c,v 1.10 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: pig.c,v 1.11 2004/11/05 21:30:32 dsl Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\ #if 0 static char sccsid[] = "@(#)pig.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: pig.c,v 1.10 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: pig.c,v 1.11 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -102,9 +102,9 @@ pigout(buf, len) int olen, allupper, firstupper; /* See if the word is all upper case */ - allupper = firstupper = isupper(buf[0]); + allupper = firstupper = isupper((unsigned char)buf[0]); for (i = 1; i < len && allupper; i++) - allupper = allupper && isupper(buf[i]); + allupper = allupper && isupper((unsigned char)buf[i]); /* * If the word starts with a vowel, append "way". Don't treat 'y' @@ -121,7 +121,7 @@ pigout(buf, len) * isn't treated as a vowel. */ if (!allupper) - buf[0] = tolower(buf[0]); + buf[0] = tolower((unsigned char)buf[0]); for (start = 0, olen = len; !strchr("aeiouyAEIOUY", buf[start]) && start < olen;) { ch = buf[len++] = buf[start++]; @@ -130,7 +130,7 @@ pigout(buf, len) buf[len++] = buf[start++]; } if (firstupper) - buf[start] = toupper(buf[start]); + buf[start] = toupper((unsigned char)buf[start]); (void)printf("%.*s%s", olen, buf + start, allupper ? "AY" : "ay"); } diff --git a/pom/.cvsignore b/pom/.cvsignore deleted file mode 100644 index 22d80fe..0000000 --- a/pom/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -pom diff --git a/ppt/.cvsignore b/ppt/.cvsignore deleted file mode 100644 index 17d27b9..0000000 --- a/ppt/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -ppt diff --git a/primes/.cvsignore b/primes/.cvsignore deleted file mode 100644 index 14d5681..0000000 --- a/primes/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -primes diff --git a/quiz/.cvsignore b/quiz/.cvsignore deleted file mode 100644 index 31b4444..0000000 --- a/quiz/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -quiz -pathnames.h -quiz.6 diff --git a/quiz/datfiles/.cvsignore b/quiz/datfiles/.cvsignore deleted file mode 100644 index e7a2bae..0000000 --- a/quiz/datfiles/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -index diff --git a/rain/.cvsignore b/rain/.cvsignore deleted file mode 100644 index 7f48079..0000000 --- a/rain/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -rain diff --git a/rain/rain.c b/rain/rain.c index 9ae8605..e388f46 100644 --- a/rain/rain.c +++ b/rain/rain.c @@ -1,4 +1,4 @@ -/* $NetBSD: rain.c,v 1.16 2004/02/08 22:21:57 jsm Exp $ */ +/* $NetBSD: rain.c,v 1.17 2004/05/02 21:31:23 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)rain.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: rain.c,v 1.16 2004/02/08 22:21:57 jsm Exp $"); +__RCSID("$NetBSD: rain.c,v 1.17 2004/05/02 21:31:23 christos Exp $"); #endif #endif /* not lint */ @@ -56,39 +56,45 @@ __RCSID("$NetBSD: rain.c,v 1.16 2004/02/08 22:21:57 jsm Exp $"); #include #include #include +#include +#include -volatile sig_atomic_t sig_caught = 0; +static volatile sig_atomic_t sig_caught = 0; -int main(int, char **); -void onsig(int); +int main(int, char **); +static void onsig(int); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int x, y, j; long cols, lines; unsigned int delay = 0; + unsigned long val = 0; int ch; + char *ep; int xpos[5], ypos[5]; /* Revoke setgid privileges */ setregid(getgid(), getgid()); - while ((ch = getopt(argc, argv, "d:h")) != -1) + while ((ch = getopt(argc, argv, "d:")) != -1) switch (ch) { case 'd': - if ((delay = (unsigned int)strtoul(optarg, (char **)NULL, 10)) < 1 - || delay > 1000) - errx(1, "invalid delay (1-1000)"); - delay *= 1000; /* ms -> us */ + val = strtoul(optarg, &ep, 0); + if (ep == optarg || *ep) + errx(1, "Invalid delay `%s'", optarg); + if (errno == ERANGE && val == ULONG_MAX) + err(1, "Invalid delay `%s'", optarg); + if (val >= 1000) + errx(1, "Invalid delay `%s' (1-999)", optarg); + delay = (unsigned int)val * 1000; /* ms -> us */ break; - case 'h': default: - (void)fprintf(stderr, "usage: rain [-d delay]\n"); - exit(1); + (void)fprintf(stderr, "Usage: %s [-d delay]\n", + getprogname()); + return 1; } initscr(); @@ -97,9 +103,6 @@ main(argc, argv) (void)signal(SIGHUP, onsig); (void)signal(SIGINT, onsig); - (void)signal(SIGQUIT, onsig); - (void)signal(SIGSTOP, onsig); - (void)signal(SIGTSTP, onsig); (void)signal(SIGTERM, onsig); curs_set(0); @@ -148,9 +151,8 @@ main(argc, argv) } } -void -onsig(dummy) - int dummy __attribute__((__unused__)); +static void +onsig(int dummy __attribute__((__unused__))) { sig_caught = 1; } diff --git a/random/.cvsignore b/random/.cvsignore deleted file mode 100644 index aceec8c..0000000 --- a/random/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -random diff --git a/robots/.cvsignore b/robots/.cvsignore deleted file mode 100644 index ab20d97..0000000 --- a/robots/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -robots -pathnames.h -robots.6 diff --git a/robots/auto.c b/robots/auto.c index c2babc4..ff80ba0 100644 --- a/robots/auto.c +++ b/robots/auto.c @@ -1,4 +1,4 @@ -/* $NetBSD: auto.c,v 1.6 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: auto.c,v 1.7 2004/08/27 09:06:25 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -42,17 +42,15 @@ * Algo : * IF scrapheaps don't exist THEN * IF not in danger THEN - * stay at current position; - * ELSE move away from the closest robot; + * stay at current position + * ELSE + * move away from the closest robot * FI * ELSE - * find closest heap; - * find closest robot; - * IF scrapheap is adjacenHEN - * move behind the scrapheap - * ELSE - * move away from the closest robot - * FI + * find closest heap + * find closest robot + * IF scrapheap is adjacent THEN + * move behind the scrapheap * ELSE * take the move that takes you away from the * robots and closest to the heap diff --git a/robots/main.c b/robots/main.c index ddc28cf..5b5d462 100644 --- a/robots/main.c +++ b/robots/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.20 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: main.c,v 1.21 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: main.c,v 1.20 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: main.c,v 1.21 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -76,7 +76,7 @@ main(ac, av) bad_arg = FALSE; for (++av; ac > 1 && *av[0]; av++, ac--) if (av[0][0] != '-') - if (isdigit(av[0][0])) + if (isdigit((unsigned char)av[0][0])) Max_per_uid = atoi(av[0]); else { Scorefile = av[0]; diff --git a/robots/move.c b/robots/move.c index d224b65..7edaae3 100644 --- a/robots/move.c +++ b/robots/move.c @@ -1,4 +1,4 @@ -/* $NetBSD: move.c,v 1.11 2003/08/07 09:37:36 agc Exp $ */ +/* $NetBSD: move.c,v 1.12 2004/08/27 09:07:08 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: move.c,v 1.11 2003/08/07 09:37:36 agc Exp $"); +__RCSID("$NetBSD: move.c,v 1.12 2004/08/27 09:07:08 christos Exp $"); #endif #endif /* not lint */ @@ -90,9 +90,13 @@ get_move() #endif else { over: - if (Auto_bot) + if (Auto_bot) { c = automove(); - else + if (!Jump) { + usleep(10000); + refresh(); + } + } else c = getchar(); if (isdigit(c)) { Count = (c - '0'); @@ -181,7 +185,7 @@ teleport: flush_in(); goto ret; case CTRL('L'): - wrefresh(curscr); + refresh(); break; case EOF: break; diff --git a/sail/.cvsignore b/sail/.cvsignore deleted file mode 100644 index b5cd682..0000000 --- a/sail/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -sail -pathnames.h diff --git a/sail/dr_1.c b/sail/dr_1.c index 6610af4..df2ade3 100644 --- a/sail/dr_1.c +++ b/sail/dr_1.c @@ -1,4 +1,4 @@ -/* $NetBSD: dr_1.c,v 1.19 2003/08/07 09:37:41 agc Exp $ */ +/* $NetBSD: dr_1.c,v 1.21 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: dr_1.c,v 1.19 2003/08/07 09:37:41 agc Exp $"); +__RCSID("$NetBSD: dr_1.c,v 1.21 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -425,14 +425,11 @@ next(void) if (tp == 0) p = "Driver"; else { - if (islower(*tp)) - *tp = toupper(*tp); + *tp = toupper((unsigned char)*tp); p = tp; } - strncpy(bestship->file->captain, p, + strlcpy(bestship->file->captain, p, sizeof bestship->file->captain); - bestship->file->captain - [sizeof bestship->file->captain - 1] = 0; logger(bestship); } return -1; diff --git a/sail/misc.c b/sail/misc.c index fe6ca52..840dc72 100644 --- a/sail/misc.c +++ b/sail/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.14 2004/02/08 00:32:48 jsm Exp $ */ +/* $NetBSD: misc.c,v 1.15 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: misc.c,v 1.14 2004/02/08 00:32:48 jsm Exp $"); +__RCSID("$NetBSD: misc.c,v 1.15 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -190,7 +190,7 @@ colours(struct ship *sp) if (sp->file->struck) return flag; flag = *countryname[capship(sp)->nationality]; - return sp->file->FS ? flag : tolower(flag); + return sp->file->FS ? flag : tolower((unsigned char)flag); } void diff --git a/sail/pl_4.c b/sail/pl_4.c index 5d2a16f..7958b56 100644 --- a/sail/pl_4.c +++ b/sail/pl_4.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_4.c,v 1.14 2003/08/07 09:37:44 agc Exp $ */ +/* $NetBSD: pl_4.c,v 1.15 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)pl_4.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_4.c,v 1.14 2003/08/07 09:37:44 agc Exp $"); +__RCSID("$NetBSD: pl_4.c,v 1.15 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -95,7 +95,7 @@ lookout(void) sgetstr("What ship? ", buf, sizeof buf); foreachship(sp) { c = *countryname[sp->nationality]; - if ((c == *buf || tolower(c) == *buf || colours(sp) == *buf) + if ((tolower((unsigned char)c) == *buf || colours(sp) == *buf) && (sp->file->stern == buf[1] || sterncolour(sp) == buf[1] || buf[1] == '?')) { eyeball(sp); diff --git a/sail/pl_5.c b/sail/pl_5.c index c8d9229..b3bdd77 100644 --- a/sail/pl_5.c +++ b/sail/pl_5.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_5.c,v 1.16 2003/08/07 09:37:44 agc Exp $ */ +/* $NetBSD: pl_5.c,v 1.17 2004/11/05 21:30:32 dsl Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)pl_5.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_5.c,v 1.16 2003/08/07 09:37:44 agc Exp $"); +__RCSID("$NetBSD: pl_5.c,v 1.17 2004/11/05 21:30:32 dsl Exp $"); #endif #endif /* not lint */ @@ -122,7 +122,7 @@ acceptmove(void) *p-- = '\0'; break; default: - if (!isspace(*p)) { + if (!isspace((unsigned char)*p)) { Msg("Input error."); *p-- = '\0'; } diff --git a/sail/sync.c b/sail/sync.c index cb7a078..5e9b9ce 100644 --- a/sail/sync.c +++ b/sail/sync.c @@ -1,4 +1,4 @@ -/* $NetBSD: sync.c,v 1.22 2004/01/27 20:27:59 jsm Exp $ */ +/* $NetBSD: sync.c,v 1.23 2004/09/07 13:20:39 jrf Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: sync.c,v 1.22 2004/01/27 20:27:59 jsm Exp $"); +__RCSID("$NetBSD: sync.c,v 1.23 2004/09/07 13:20:39 jrf Exp $"); #endif #endif /* not lint */ @@ -380,9 +380,8 @@ sync_update(int type, struct ship *ship, const char *astr, long a, long b, long break; } case W_CAPTAIN: - strncpy(ship->file->captain, astr, - sizeof ship->file->captain - 1); - ship->file->captain[sizeof ship->file->captain - 1] = 0; + strlcpy(ship->file->captain, astr, + sizeof ship->file->captain); break; case W_CAPTURED: if (a < 0) @@ -419,9 +418,8 @@ sync_update(int type, struct ship *ship, const char *astr, long a, long b, long ship->specs->hull = a; break; case W_MOVE: - strncpy(ship->file->movebuf, astr, - sizeof ship->file->movebuf - 1); - ship->file->movebuf[sizeof ship->file->movebuf - 1] = 0; + strlcpy(ship->file->movebuf, astr, + sizeof ship->file->movebuf); break; case W_PCREW: ship->file->pcrew = a; diff --git a/snake/snake/.cvsignore b/snake/snake/.cvsignore deleted file mode 100644 index 49bb99f..0000000 --- a/snake/snake/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -snake -pathnames.h -snake.6 diff --git a/snake/snscore/.cvsignore b/snake/snscore/.cvsignore deleted file mode 100644 index 2f98e3a..0000000 --- a/snake/snscore/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -snscore diff --git a/tetris/.cvsignore b/tetris/.cvsignore deleted file mode 100644 index 59387df..0000000 --- a/tetris/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -tetris -pathnames.h -tetris.6 -tetris-bsd.6 diff --git a/trek/.cvsignore b/trek/.cvsignore deleted file mode 100644 index ff27e51..0000000 --- a/trek/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -trek -trek.6 diff --git a/trek/getpar.h b/trek/getpar.h index 8363697..20527c3 100644 --- a/trek/getpar.h +++ b/trek/getpar.h @@ -1,4 +1,4 @@ -/* $NetBSD: getpar.h,v 1.9 2004/01/27 20:30:31 jsm Exp $ */ +/* $NetBSD: getpar.h,v 1.10 2005/02/15 12:54:50 jsm Exp $ */ /* * Copyright (c) 1980, 1993 @@ -40,6 +40,9 @@ struct cvntab /* used for getcodpar() parameter list */ int value2; }; +extern const struct cvntab Skitab[]; +extern const struct cvntab Lentab[]; + int getintpar(const char *); double getfltpar(const char *); int getynpar(const char *); diff --git a/trek/trek.h b/trek/trek.h index 5a824dc..62ac1df 100644 --- a/trek/trek.h +++ b/trek/trek.h @@ -1,4 +1,4 @@ -/* $NetBSD: trek.h,v 1.10 2004/01/27 20:30:31 jsm Exp $ */ +/* $NetBSD: trek.h,v 1.11 2005/02/15 12:54:50 jsm Exp $ */ /* * Copyright (c) 1980, 1993 @@ -205,9 +205,6 @@ struct xy }; -extern const struct cvntab Skitab[]; -extern const struct cvntab Lentab[]; - /* * note that much of the stuff in the following structs CAN NOT * be moved around!!!! diff --git a/worm/.cvsignore b/worm/.cvsignore deleted file mode 100644 index 87377a6..0000000 --- a/worm/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -worm diff --git a/worms/.cvsignore b/worms/.cvsignore deleted file mode 100644 index 9776c02..0000000 --- a/worms/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -worms diff --git a/worms/Makefile.bsd b/worms/Makefile.bsd index f7e51fb..31721eb 100644 --- a/worms/Makefile.bsd +++ b/worms/Makefile.bsd @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.6 1998/02/18 22:37:32 jtc Exp $ +# $NetBSD: Makefile,v 1.7 2004/11/13 10:22:13 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 +WARNS=3 PROG= worms MAN= worms.6 DPADD= ${LIBCURSES} diff --git a/worms/worms.c b/worms/worms.c index e78f1b4..6dbbbcf 100644 --- a/worms/worms.c +++ b/worms/worms.c @@ -1,4 +1,4 @@ -/* $NetBSD: worms.c,v 1.14 2004/02/08 22:21:57 jsm Exp $ */ +/* $NetBSD: worms.c,v 1.16 2004/09/12 04:51:32 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)worms.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: worms.c,v 1.14 2004/02/08 22:21:57 jsm Exp $"); +__RCSID("$NetBSD: worms.c,v 1.16 2004/09/12 04:51:32 christos Exp $"); #endif #endif /* not lint */ @@ -273,7 +273,6 @@ main(argc, argv) (void)signal(SIGHUP, onsig); (void)signal(SIGINT, onsig); (void)signal(SIGQUIT, onsig); - (void)signal(SIGSTOP, onsig); (void)signal(SIGTSTP, onsig); (void)signal(SIGTERM, onsig); @@ -295,7 +294,12 @@ main(argc, argv) endwin(); exit(0); } - if (delay) usleep(delay); + if (delay) { + if (delay % 1000000 != 0) + usleep(delay % 1000000); + if (delay >= 1000000) + sleep(delay / 1000000); + } for (n = 0, w = &worm[0]; n < number; n++, w++) { if ((x = w->xpos[h = w->head]) < 0) { mvaddch(y = w->ypos[h] = bottom, diff --git a/wtf/.cvsignore b/wtf/.cvsignore deleted file mode 100644 index f79a525..0000000 --- a/wtf/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -wtf.6 -wtf diff --git a/wtf/acronyms b/wtf/acronyms index e6b0f7e..5baeef2 100644 --- a/wtf/acronyms +++ b/wtf/acronyms @@ -1,5 +1,6 @@ -$NetBSD: acronyms,v 1.135 2004/01/14 13:46:26 keihan Exp $ +$NetBSD: acronyms,v 1.145 2005/02/18 01:40:49 jsm Exp $ +AFAIC as far as I'm concerned AFAICR as far as I can recall AFAICT as far as I can tell AFAIK as far as I know @@ -17,6 +18,7 @@ ASAP as soon as possible ATM at the moment AWOL absent without official leave AYBABTU all your base are belong to us +AYT are you there B/C because B/S bullshit B/W between @@ -42,6 +44,7 @@ BTW by the way CMIIW correct me if I'm wrong CNP continued [in my] next post COB close of business [day] +COTS commercial off-the-shelf CYA see you around D/L download DIY do it yourself @@ -105,9 +108,10 @@ ISAGN I see a great need ISTM it seems to me ISTR I seem to recall ITYM I think you mean -IYSS if you say so IWBNI it would be nice if +IYSS if you say so J/K just kidding +JHD just hit ``delete'' JIC just in case JK just kidding JMO just my opinion @@ -117,6 +121,7 @@ KITA kick in the ass KNF kernel normal form L8R later LART luser attitude readjustment tool (ie, hammer) +LBNL last but not least LJBF let's just be friends LMAO laughing my ass off LMSO laughing my socks off @@ -157,6 +162,7 @@ PNG persona non grata PNP plug and pray POC point of contact POLA principle of least astonishment +POLS principle of least surprise POS piece of shit PPL pretty please PTV parental tunnel vision @@ -194,6 +200,7 @@ SOP standard operating procedure SSIA subject says it all STFA search the fucking archives STFU shut the fuck up +STFW search the fucking web SUS stupid user syndrome SWAG silly, wild-assed guess SWAHBI silly, wild-assed hare-brained idea @@ -210,7 +217,9 @@ TLA three letter acronym TLB translation lookaside buffer TMA too many abbreviations TMI too much information +TNF The NetBSD Foundation TOEFL test of english as a foreign language +TPTB the powers that be TRT the right thing TTBOMK to the best of my knowledge TTFN ta ta for now diff --git a/wtf/acronyms.comp b/wtf/acronyms.comp index 85b5ced..6f2b66f 100644 --- a/wtf/acronyms.comp +++ b/wtf/acronyms.comp @@ -1,72 +1,121 @@ -$NetBSD: acronyms.comp,v 1.37 2004/01/15 03:35:20 grant Exp $ +$NetBSD: acronyms.comp,v 1.58 2005/02/16 00:04:23 kleink Exp $ +3WHS three-way handshake ABI application binary interface +ACL access control list ACPI advanced configuration and power interface ADC analog [to] digital converter +ADPCM adaptive differential pulse code modulation +ADSL asymmetric digital subscriber line AGP accelerated graphics port -ANSI American National Standards Institute +AM amplitude modulation +AMI alternate mark inversion +ANSI american national standards institute +AP access point API application programming interface -ARP address resolution protocol APIC advanced programmable interrupt controller +ARP address resolution protocol +ARQ automatic repeat request +AS autonomous system +ASN autonomous system number +ASCII american standard code for information interchange AT advanced technology ATA advanced technology attachment ATAPI advanced technology attachment packet interface ATM asynchronous transfer mode ATX advanced technology extended BEDO burst extended data output +BER basic encoding rules +BER bit error rate BGP border gateway protocol BIOS basic input/output system BLOB binary large object +BPS bits per second BSD berkeley software distribution CAD computer-aided design CAV constant angular velocity (as opposed to CLV) +CCD charge coupled device CD compact disc +CDDA compact disc digital audio CDRAM cache dynamic random access memory +CER canonical encoding rules CGA color graphics array CGI common gateway interface CHS cylinder/head/sector CIDR classless inter-domain routing +CIS contact image sensor CLI command line interface CLV constant linear velocity (as opposed to CAV) +CMYK cyan magenta yellow black COFF common object file format +COW copy-on-write CPU central processing unit CRLF carriage return line feed CRT cathode ray tube +CSMA carrier sense multiple access +CSMA/CA carrier sense multiple access with collision avoidance +CSMA/CD carrier sense multiple access with collision detection CSS cascading style sheets +CTS clear to send CVS concurrent versions system DAC digital [to] analog converter +DCE data control equipment +DCE distributed computing environment +DCT discrete cosine transform DDC display data channel DDR double data rate DDWG digital display working group +DER distinguished encoding rules +DFT discrete fourier transform DHCP dynamic host configuration protocol +DIFS distributed inter-frame space +DLE data link escape DMA direct memory access DNS domain name system +DOS denial of service +DPCM differential pulse code modulation +DPI dots per inch DRAM dynamic random access memory DSL digital subscriber line +DSSS direct sequence spread spectrum DTD document type definition +DTE data terminal equipment +DTE dumb terminal emulator DVD digital versatile disc DVI digital visual interface ECP enhanced capability port EDID extended display identification data EDO extended data out EEPROM electrically erasable programmable read only memory +EFM eight to fourteen modulation EGA enhanced graphics array +EGP exterior gateway protocol EISA extended industry standard architecture ELF executable and linking format EPP enhanced parallel port +EPRML extended partial response, maximum likelihood EPROM erasable programmable read only memory ESDRAM enhanced synchronous dynamic random access memory +E-XER extended XML encoding rules FAT file allocation table FBRAM frame buffer random access memory +FCS frame check sequence +FDDI fiber distributed data interface FFS fast file system +FHSS frequency hop spread spectrum +FIR fast infrared FLOPS floating [point] operations per second +FM frequency modulation FPM fast page mode FQDN fully qualified domain name FTP file transfer protocol +GC garbage collector +GCR group-coded recording GIF graphics interchange format GNU gnu's not unix GPL gnu/general public license GPU graphics processing unit +GRE generic routing encapsulation GUI graphics user interface HDCP high-bandwidth digital content protection HTML hyper-text markup language @@ -77,13 +126,16 @@ IC integrated circuit ICB internet citizen's band ICMP internet control message protocol IDE integrated drive electronics -IEC International Electrotechnical Commission +IDRP inter-domain routing protocol +IEC international electrotechnical commission IEEE institute [of] electrical [and] electronics engineers IESG internet engineering steering group IETF internet engineering task force +IGP interior gateway protocol IKE internet key exchange IMAP internet mail access protocol -INCITS InterNational Committee on Information Technology Standards +INCITS international committee on information technology standards +IPC interprocess communication IO input/output IOCTL input/output control IP internet protocol @@ -94,7 +146,10 @@ IRQ interrupt request IRTF internet research task force ISA industry standard architecture ISDN integrated services digital network -ISO International Standards Organization +ISI inter-symbol interference +ISM industrial, scientific and medical +ISN initial serial number +ISO international standards organization ISOC internet society ISP internet service provider JPEG joint photographic experts group @@ -102,69 +157,107 @@ KVA kernel virtual address LAN local area network LBA logical block addressing LCD liquid crystal display +LCP link control protocol LDAP lightweight directory access protocol LED light emitting diode LIR local internet registry +LLC logical link control +LRC longitudinal redundancy check LSB least significant bit [or: byte] LUN logical unit number -MAC media access control +LZW Lempel Ziv Welch +MAC medium access control MBR master boot record MDRAM multibank dynamic random access memory +MFM modified frequency modulation MIDI musical instrument digital interface MIME multipurpose internet mail extensions MIPS million instructions per second MMU memory management unit MPEG moving picture experts group MSB most significant bit [or: byte] +MSF minutes seconds frames +MSS maximum segment size MTA mail transfer agent MTU maximum transmission unit MUA mail user agent +MWE module width encoding NAT network address translation +NAV network allocation vector +NCP network control protocol NFS network file system NIC network interface card NIS network information service +NRZ non-return to zero NUMA non uniform memory access +OCL object constraint language +OCR optical character recognition OEM original equipment manufacturer +OFDM orthogonal frequency division multiplexing OSF open software foundation +OSI open systems interconnection OTP one time password PAM pluggable authentication modules +PAM pulse amplitude modulation +PAT port address translation PAX portable archive exchange +PC personal computer PCI peripheral component interconnect -PCMCIA Personal Computer Memory Card International Association +PCM pulse code modulation +PCMCIA personal computer memory card international association +PDU protocol data unit PDP page descriptor page +PER packed encoding rules PERL practical extraction [and] report language PGP pretty good privacy PIC programmable interrupt controller PID process id +PIN personal identification number PIO programmed input/output +PLL phase locked loop +PMT photo-multiplier tube PNG portable network graphics POP post office protocol POSIX portable operating system interface [for] unix POST power on self test +POTS plain old telephone system PPP point-to-point protocol PPPOA point-to-point protocol over ATM PPPOE point-to-point protocol over ethernet +PRML partial response, maximum likelihood PROM programmable read only memory PTE page table entry PTLA pseudo top level aggregator PTP page table page +PSTN public switched telephone network +PWM pulse width modulation +QOS quality of service RAID redundant array of inexpensive disks RAM random access memory RCS revision control system RFC request for comments RGB red green blue +RIP routing information protocol +RIR regional internet registry RISC reduced instruction set computing +RLE run length encoding +RLL run length limited ROM read only memory RPM revolutions per minute RTF rich text format +RTS request to send +RTT round time trip S/PDIF sony/phillips digital interface SACD super audio compact disc SAM serial access memory -SASI Shugart Associates system interface (predecessor to SCSI) +SASI shugart associates system interface (predecessor to SCSI) SATA serial advanced technology attachment SCSI small computer system interface SDRAM synchronous dynamic random access memory SGRAM synchronous graphics random access memory +SIFS short inter-frame space +SIP session initiation protocol +SIR slow infrared SLDRAM synchronous-link dynamic random access memory SMART self-monitoring analysis and reporting technology SMP symmetric multiprocessing @@ -172,39 +265,55 @@ SMTP simple mail transfer protocol SNMP simple network management protocol SPD serial presence detect SRAM static random access memory +SSFDC solid state floppy disc card SSH secure shell SSL secure sockets layer +STP shielded twisted pair SVGA super video graphics array TCL tool command language TCP transmission control protocol +TDD test driven development TFT thin film transistor TIFF tagged image file format TLA top level aggregator TLB transition lookaside buffer TLD top level domain TMDS transition minimized differential signaling +TR token ring +TTL time to live TTY teletype TZ time zone +UART universal asynchronous receiver/transmitter UC uncacheable +UDO ultra density optical (storage) UDP user datagram protocol +UFS unix file system +UML unified modeling language UPS uninterruptible power supply URI uniform resource identifier URL uniform resource locator +USART universal synchronous/asynchronous receiver/transmitter USB universal serial bus USWC uncacheable speculative write combining +UTP unshielded twisted pair UUCP unix-to-unix copy protocol VAX virtual address extension VCM virtual channel memory VESA video electronics standards association VGA video graphics array +VLAN virtual local area network +VLSM variable length subnetting mask VM virtual memory VPN virtual private network VRAM video random access memory WAN wide area network WAP wireless application protocol +WLAN wireless local area network WRAM window random access memory WWW world wide web +XER XML encoding rules XGA extended graphics array XML extensible markup language XSL extensible stylesheet language XT extended technology +ZFOD zero-filled on demand diff --git a/wump/.cvsignore b/wump/.cvsignore deleted file mode 100644 index 2865bf2..0000000 --- a/wump/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -a.out -*.d -*.i -*.s -*.d.tmp -wump -pathnames.h diff --git a/wump/wump.c b/wump/wump.c index 67a9a2c..ec21a14 100644 --- a/wump/wump.c +++ b/wump/wump.c @@ -1,4 +1,4 @@ -/* $NetBSD: wump.c,v 1.16 2004/01/27 20:30:31 jsm Exp $ */ +/* $NetBSD: wump.c,v 1.17 2005/02/15 12:56:20 jsm Exp $ */ /* * Copyright (c) 1989, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)wump.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: wump.c,v 1.16 2004/01/27 20:30:31 jsm Exp $"); +__RCSID("$NetBSD: wump.c,v 1.17 2005/02/15 12:56:20 jsm Exp $"); #endif #endif /* not lint */ @@ -776,7 +776,7 @@ puff of greasy black smoke! (poof)\n"); err(1, "open %s", _PATH_WUMPINFO); if (dup2(fd, STDIN_FILENO) == -1) err(1, "dup2"); - (void)execl("/bin/sh", "sh", "-c", pager, NULL); + (void)execl("/bin/sh", "sh", "-c", pager, (char *) NULL); err(1, "exec sh -c %s", pager); case -1: err(1, "fork");