Commit Graph

2310 Commits

Author SHA1 Message Date
rillig ac598ab1cf fish: remove modulo bias from random number generation
It probably doesn't matter in practice, but omitting this piece of code
always looks like an oversight.
2021-05-01 21:10:57 +00:00
rillig 6a70979a86 cgram: rename local functions
The word 'cleanup' should have been named clean_up all along, but 'done'
is even shorter.

No functional change.
2021-05-01 20:29:23 +00:00
rillig c6b805dbac caesar: WARNS=6, strict bool mode
The rotation is validated to be nonnegative, therefore use unsigned int
for it.
2021-05-01 20:21:25 +00:00
rillig c9b39ce704 cgram: in hinting mode, show all correct characters in bold face
For almost solved cryptograms, this makes the punctuation stand out
less, helping to focus on the missing letters.
2021-04-29 20:17:20 +00:00
rillig 3e4a0edf9f cgram: use ASCII-only implementation of <ctype.h> functions
The function 'encode' already assumes that all letter characters are
contiguous and that there are only 26 letters of each case.  At the
moment, cgram cannot handle UTF-8 anyway since it reads the input
byte-wise, assuming that each byte is exacty one character.
2021-04-25 20:38:03 +00:00
rillig 0721cc8d68 cgram: provide usage on incorrect invocation 2021-04-25 20:19:19 +00:00
rillig 1f36a02f91 cgram: conform to lint's strict bool mode, KNF 2021-04-25 20:14:29 +00:00
wiz 69305a0d1c cgram: allow providing an input file instead of the random fortune 2021-04-22 14:57:36 +00:00
mrg e6d9bbbe8f one port complains about string overflow here that i can't see. 2021-04-15 01:55:21 +00:00
mrg 4caf7d9e65 avoid duplicating symbols in libterminfo. 2021-04-13 08:06:38 +00:00
mrg af0a9e8c91 no longer need -Wno-error=implicit-fallthrough.
don't provide common symbols that are in libterminfo now days.
2021-04-13 02:11:39 +00:00
mrg 4c266a5438 properly terminate after using strncpy(). 2021-04-13 01:50:46 +00:00
mrg 18bae9314b avoid leaving off the trailing nul in a literal string. 2021-04-12 09:12:28 +00:00
mrg 84bbce3d17 include bsd.own.mk to be sure NETBSDSRCDIR is set. 2021-04-12 04:19:32 +00:00
mrg a2d1542565 add some new uses of existing GCC_NO_* variables for warning issues.
remove an no longer relevant for gcc7 workaround (works fine in both
gcc9 and gcc 10.)
2021-04-12 02:54:07 +00:00
rillig 32eb951e74 cgram: don't beep if the window is resized 2021-02-26 15:18:40 +00:00
rillig 550a2d894f cgram: place the 'solved' marker nearer to the text
This way, it cannot be overlooked as easily as before.  It also doesn't
change the position of the keyboard help text anymore.  Only if there is
not enough space, the 'solved' marker is put into the bottom line.
2021-02-26 15:15:34 +00:00
rillig 531f30a38a cgram: make the 'solved' stand out more
Suggested by Weitian LI via [1].

[1] https://github.com/NetBSD/src/commit/efec6410b2b5a736
2021-02-26 14:55:37 +00:00
rillig 6ec38e5b23 cgram: fix assertion when substituting at the end of the longest line
Reported by Weitian LI via GitHub.

Contrary to the patch suggested in [1], still allow the cursor to be
placed to the very right of the text in a line since that is the usual
behavior of text editors.

Split the function substitute() into two parts:  one that handles the
curses-specific part of checking whether a substitution is possible at
the current cursor position, and one that performs the actual
substitution.  Only the latter is kept in the code section for the
string manipulation functions, the other is moved to the section for
curses code.  Having all the curses code in one place reduces the places
that call beep().  Previously, as well as now, there is a single beep
per invalid key before, but that was not obvious from the previous code.

[1]: https://github.com/DragonFlyBSD/DragonFlyBSD/commit/18d09f18cf4c
2021-02-22 19:34:07 +00:00
rillig f7c85ecb67 cgram: add advanced cursor movement with tab, shift+tab, return 2021-02-22 17:36:42 +00:00
rillig 47c6585f93 cgram: properly handle input errors
On both NetBSD and Cygwin, a missing /usr/bin/fortune would previously
continue since popen does not return an error (as /bin/sh is found and
can be executed), so the next chance to catch an error is pclose.  At
that point, the shell has already printed an informative error message
about what happened (or what didn't happen), so that cgram does not need
to print an error by itself.
2021-02-22 16:28:20 +00:00
rillig 9510ff87da cgram: allow navigation with KEY_PPAGE and KEY_NPAGE 2021-02-21 22:21:56 +00:00
rillig 1646b19068 cgram: rewrite completely, fixing bugs and style
Fixed bugs:

Do not consider the puzzle solved if all letters in the visible area are
substituted correctly.  To be properly solved, the whole puzzle must be
solved, even those parts that are currently off-screen.

Never place the cursor at the very right edge of the screen since that
does not work well with some terminals.  The maximum valid x coordinate
is COLS - 1.

Add horizontal scrolling.  Make all coordinate handling symmetric in
regard to the horizontal and vertical axes.  Previously, lines longer
than 80 characters could not be seen on the screen.

Improvements:

Remove the arbitrary limit of 128 characters per line.  Even if
fortune(6) may never generate such long lines, the code is easy enough
to adapt to other sources.

Properly clean up the allocated memory.  Previously, only the string
arrays were freed but not the strings themselves.

Stylistic:

Add RCS ID.

Fix ctype functions in lint's strict bool mode.

Avoid excessive calls to strlen whenever the cursor moves.  Given that
the whole screen is redrawn every time a key is pressed, this is an
unnecessary optimization, but the code smelled nevertheless.
2021-02-21 20:33:42 +00:00
rillig 12c09445ec cgram: WARNS=6, use int for all coordinates
Eliminate some frequently occurring subexpressions during substitution.

No functional change, assuming that fortune(6) always spits out less
than 2 gigacharacters of text.
2021-02-21 17:16:00 +00:00
rillig f21d40b5e2 cgram: consistently use char for characters
Having to convert back and forth between char, unsigned char and int is
confusing.  Just stay with char, until the support for wide characters
is added.

No functional change.
2021-02-21 16:50:57 +00:00
rillig c414f53223 cgram: fix undefined behavior when pressing function keys
The key codes for function keys are outside of the "range representable
by an unsigned char".  This resulted in parts of the screen being
cleaned.
2021-02-21 16:37:26 +00:00
rillig 905a01e770 cgram: adjust style to survive lint's strict bool mode
The biggest change is the return type of substitute().  Before, 0 meant
success, now false means failure.

No functional change.
2021-02-21 16:05:44 +00:00
rillig 43892d8404 cgram: sort includes 2021-02-21 15:42:21 +00:00
rillig b15c3153c9 cgram: indent
With manual corrections afterwards:

- indent removes empty lines between statement and declaration.  This
  had been a syntax error in C90, since C99 this is common style and
  should be accepted by indent.

- indent didn't format the first line of main for whatever reason, did
  that manually.

- indent removed the empty line above the '/////' separators.  It should
  have left these empty lines as-is.
2021-02-21 15:41:04 +00:00
rillig 0aae6846c3 cgram: fix Home key for cursor navigation
Reported by liweitianux via GitHub.
2021-02-21 13:35:37 +00:00
christos 6fceff0a4e - Don't allocate memory dynamically on the stack (for SSP)
- Don't return errno as exit code
- Fold long lines
2021-01-08 15:16:04 +00:00
jmcneill 8582796087 set the cursor to invisible 2021-01-02 12:12:26 +00:00
jmcneill b7ebe3f39d trailing whitespace 2021-01-02 12:10:17 +00:00
wiz a2a2d948d4 Markup/typo fixes. 2021-01-02 08:55:51 +00:00
nat ad733c96b3 Add testpat(6) to games.
Testpat displays a test pattern in curses(3).
2021-01-02 03:21:39 +00:00
dholland ce47fd40df speed limit 80 2020-12-06 11:41:47 +00:00
dholland 475cad6763 speed limit 80 2020-12-06 11:35:27 +00:00
rin f52e729971 roundsleep(): Too many zeros; tv_nsec should be compared with
500 msec, not 5000. Raised by clang for ILP32 archs.
2020-11-21 09:24:02 +00:00
joerg a5e6526bbc Avoid common symbols. Use __dead. 2020-11-12 22:23:16 +00:00
christos f5001bc688 Comment out debugging build (it still randomly crashes though) pointed out
by wiz
2020-11-11 20:04:02 +00:00
christos 29ab367558 use strchr, strrchr, random, more lint removal, savefile in /var/games/warp
not /usr/share/games/warp...
2020-11-11 19:55:33 +00:00
christos b853388890 no need for -lcompat 2020-11-11 19:54:53 +00:00
christos 6ecf74c0f6 - use termios
- enable setgid games
- enable savedir
2020-11-11 17:11:19 +00:00
kamil ec609ce1aa Fix the old leftover license note
Larry Wall: "I outgrew commercial-free licensing about 30 years ago."
2020-11-11 11:54:42 +00:00
christos e8edee0bb7 remove error(1) comments 2020-11-10 23:32:33 +00:00
christos 17184abace Antivaxer support. 2020-11-10 23:03:22 +00:00
christos b90df07acf can't have config.h and config.H in case-preserving but case-folding file-systems. 2020-11-10 22:56:49 +00:00
christos ccdf7d95e3 don't segv if the terminal is too big. 2020-11-10 22:52:45 +00:00
christos e123ae1b57 pray-tell where are you trying to write? 2020-11-10 22:52:32 +00:00
christos e7d77274fb Time warp forward 34 years so that it compiles (but not work) 2020-11-10 22:42:19 +00:00
kamil deb8b2cb72 Remove the smap.* files
They are generated during the build.
2020-11-10 11:29:29 +00:00
kamil 2710a02cd6 Integrate Warp Kit into the NetBSD build
Fix the build and make it install and run with minimal required changes.
2020-11-10 08:49:08 +00:00
kamil 653de20730 Reset CVS keywords 2020-11-10 00:02:11 +00:00
kamil 59ba73f691 Add Warp Kit, Version 7.0 by Larry Wall
Warp is a real-time space war game that doesn't get boring very quickly.
Read warp.doc and the manual page for more information.

games/warp originally distributed with 4.3BSD-Reno, is back to the BSD
world via NetBSD. Its remnants were still mentioned in games/Makefile.

Larry Wall, the original author and the copyright holder, generously
donated the game and copyright to The NetBSD Foundation, Inc.

Import the game sources as-is from 4.3BSD-Reno, with the cession
of the copyright and license to BSD-2-clause NetBSD-style.

Signed-off-by: Larry Wall <larry@wall.org>
Signed-off-by: Kamil Rytarowski <kamil@netbsd.org>
2020-11-09 23:37:05 +00:00
dholland 386c99328f Restore the catman joke.
It needs the (8), or it fails to work for people who don't know or had
forgotten catman(8) was ever a thing.

as the de facto fortunes editor and also I think the person who added
that fortune in the first place, and given the discussion in
tech-userlevel, I think I get to do this.
2020-11-09 03:23:14 +00:00
kamil fa5b5b5087 Revert to the original phrasing, but remove the man 8 section reference.
catman is a historical Unix tool.
2020-11-09 00:46:00 +00:00
kamil dfc109fe43 catman(8) is a past thing 2020-11-08 17:37:29 +00:00
simonb 2286c9861b Add one. 2020-10-30 04:56:32 +00:00
nia 8f725d8695 rain(6): Make the default delay useful for modern terminals 2020-10-14 18:32:04 +00:00
nia 7aac251b81 worms(6): Use a reasonable default delay for non-1980s terminals.
This is still fast, but not unreasonably fast.
2020-10-14 07:32:53 +00:00
christos 5d858a7a6b - remove duplicate comment
- flush after printing the number
(from kre@)
2020-10-12 13:54:51 +00:00
christos c6669ee4d0 more clarifications. 2020-10-12 13:53:43 +00:00
christos df7f34cf57 mention hex numbers 2020-10-11 18:48:20 +00:00
christos 662c0e244b Remove is_hex_str() (trying to guess if a number was hex or not). It is not
documented and can lead to unexpected behavior.
2020-10-11 18:46:21 +00:00
christos f1aebb0c36 From gson@
- don't assume -h is always on for large factors
- fix saved large factors printing when -h
2020-10-11 17:18:34 +00:00
christos 0540874be3 - for readability when the exponent < 10 don't prefix it with 0x (from kre)
- fix usage
- merge printing code.
2020-10-07 19:48:29 +00:00
christos c5aeb8a719 PR/55695: Andreas Gustafsson: factor(6) -h option doesn't always work
Handle -h for factors greater than the primes table.
2020-10-05 21:11:47 +00:00
christos a17b1cd2d7 revert previous and don't parse octal 2020-10-05 14:31:30 +00:00
tnn 7f481043e4 factor: usage(): mark __dead 2020-10-05 12:22:49 +00:00
christos 2c61d0e8cd - Accept octal input.
- Don't play with the original string so we can print it.
2020-10-04 19:32:15 +00:00
kre 5bbbc6a94d Fix a typo (s/int/in/) 2020-10-04 14:22:52 +00:00
christos 5e85fe34cc PR/55693: Andreas Gustafsson: factor(6) lists factors in wrong order
Sync with FreeBSD and change their -h (that printed hex) to -x because
we were already using -h.
2020-10-03 22:27:00 +00:00
mrg 1ff60d1f84 avoid uninit memory and use memmove vs strncpy for a will be
truncated on purpose string.
2020-09-07 00:31:11 +00:00
mrg 07f014edcb apply ${GCC_NO_FORMAT_TRUNCATION} to scores.c 2020-09-06 10:51:20 +00:00
msaitoh cc67c5474a s/ be be / be / 2020-08-19 02:19:06 +00:00
nia 42708011d3 robots: Use arc4random_uniform for better uniform distribution 2020-07-26 15:38:22 +00:00
nia e54fc04f5a random(6): Use arc4random_uniform to simplify code 2020-07-26 15:24:00 +00:00
nia e59dc3e7bc Revert arc4random usage for now
this is a host tool and needs to be portable

future plans: add arc4random to libnbcompat
2020-07-26 15:14:09 +00:00
nia 6e4479f819 fortune: arc4random_uniform for better uniform values than random() % ... 2020-07-21 03:05:40 +00:00
nia 6ad85e2cf9 tetris: Use arc4random_uniform instead of modulo for better randomness 2020-07-21 02:42:05 +00:00
dholland 7ca3fbbe70 Avoid messing up the display when too many letters are guessed at once.
The field to put them in was made 26 characters wide... but includes
the string "Guessed: ". So if you get to 17 it wraps to the next line
and clreol()'s it. Instead, when reaching this point step on the
"Guessed:" string instead.

Reported by phil@.
2020-07-12 02:34:54 +00:00
rillig e8699354fb cgram(6): use standard cursor keys, use standard shuffle algorithm
The previous shuffle algorithm asked for 100 random numbers, on average.
The new algorithm asks exactly for 26 random numbers.

Curses predefines numeric constants for keys, and there is no apparent
reason not to use these standard keys for cursor movement.
2020-07-02 19:11:01 +00:00
sevan 328e83a3c0 A revision of "The purpose of computing is insight, not numbers" by
Richard Hamming.
From The Art of Doing Science and Engineering
2020-06-15 12:57:51 +00:00
leot 5cd696c2e3 Recommend using `pkg_admin {fetch-pkg-vulnerabilities,audit}' instead of
{download-vulnerability-list,audit-packages}.
2020-06-07 15:41:03 +00:00
leot 3acc7de7ef Properly quote printf string
Noticed by Ottavio Caruso on #netbsd@Freenode, thanks!
2020-06-07 15:37:04 +00:00
sevan dc34a600e7 Heads up on Bell patents
P21 on https://minnie.tuhs.org/Archive/Documentation/AUUGN/AUUGN-V01.1.pdf
2020-05-18 20:19:08 +00:00
msaitoh 8012ca3f0e Remove extra semicolon. 2020-05-14 08:34:17 +00:00
christos 58acbfa340 Simplify, little KNF 2020-04-30 12:40:11 +00:00
christos 8e08aa4add Simplify, errors to stderr. 2020-04-30 12:32:26 +00:00
nia 669bbdba3b unstr: Check that the input filename fits in the buffer. 2020-04-29 21:00:42 +00:00
nia 5774e6823b strfile: Check that input/output filenames don't exceed the buffer size 2020-04-29 20:45:05 +00:00
joerg adc9d2a05f buffnum is shared between subs.c and fancy.c 2020-04-22 23:36:26 +00:00
sevan 12fff5803d Disks can sense vibes, DTrace confirms it.
https://youtu.be/tDacjrSCeq4
2020-04-02 05:55:02 +00:00
sevan 8744e0a0e1 Andrew Weatherall's tattoo and a track on A Pox On The Pioneers album.
https://pbs.twimg.com/media/ERAuddhU4AAFv3w?format=jpg&name=orig
Story:
https://www.dummymag.com/features/andrew-weatherall-interview-it-s-bollocks-it-s-discos-tell-me-tales-of-the/
2020-02-22 19:03:04 +00:00
dholland 4fb51600fe something I apparently forgot to commit months or years ago 2020-02-16 23:14:19 +00:00
fox 0056d140e3 games/hack: Suppress -Werror=stringop-truncation error.
Add GCC_NO_STRINGOP_TRUNCATION to hack.end.c to prevent build failure.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
2020-02-08 00:59:55 +00:00
fox a0c9b60242 games/hack: Revert the strlcpy(1) change since this changes expected behavior from strncpy(3).
Reviewed by: kamil@
2020-02-07 22:04:02 +00:00
fox f183a7a695 games/hack: Fix -Wstringop-truncation warning.
Replace strncpy(3) with strlcpy(3).

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
2020-02-07 20:34:18 +00:00
fox c0ad960a60 games/battlestar: Replace snprintf(3) with strlcpy(3) for better performance.
Reviewed by: kamil@
2020-02-06 22:09:43 +00:00
fox 19f84ebb48 games/battlestar: Fix the -Werror=restrict warning.
Replace strcpy(1) with the safer snprintf(3) which guarantees NULL
termination of strings.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
2020-02-05 20:11:54 +00:00
msaitoh 25c7ba7c6d s/saftey/safety/ 2019-12-27 09:17:59 +00:00
msaitoh 88af233251 s/opration/operation/ 2019-12-27 07:41:22 +00:00
sevan a0e35b2411 Introspection. From "Surely You're Joking, Mr. Feynman!" 2019-12-03 22:42:29 +00:00
sevan cacc7f27a4 https://twitter.com/sei6r/status/1182433546331279360 2019-11-10 22:42:21 +00:00
sevan 700433206f Definition of austerity by Alexei Sayle on Radio 4
https://web.archive.org/web/20190916192807/https://www.bbc.co.uk/sounds/play/m0008bbc
2019-11-10 00:54:57 +00:00
christos 0e5c7640e2 Gcc-8 bug confusion with restrict on sh3 2019-10-29 21:30:42 +00:00
sevan 31c9b97559 Chris' happiest moment
http://bbc.co.uk/programmes/b09b1zbb
2019-10-27 23:31:15 +00:00
mrg b609b30b6c adjust a fallthru comment and add a missing break. 2019-10-13 07:42:57 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
mrg c8bf876ced expand the internal consistency checks in truedirec() to avoid
fallthrough cases.  now if direction turns up wrong (it should
not, but this code can't tell that, and convert it to an enum
that would also fix this, is more effort than this is worth.
2019-10-05 23:34:14 +00:00
mrg 21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
wiz 576c8e30e1 End sentence with a dot. 2019-09-02 08:26:00 +00:00
sevan b9c252d754 Document history.
https://www.bell-labs.com/usr/dmr/www/man11.pdf
Between v1 & v6 UNIX, bcd was rewritten in C, but I don't know if which version,
hence I've skipped mentioning it.
2019-09-01 22:50:11 +00:00
sevan 8f2c65b576 Donnie Darko 2019-08-22 22:51:47 +00:00
sevan 608899cdf4 The mother of all demos 2019-07-26 07:41:22 +00:00
uwe f9f52b4a0c Use .Dl for displays with single command. Specify .Bl -width with the
same formatting as the actual tags.
2019-07-23 11:02:29 +00:00
uwe 800ba6691b strfile is installed, don't claim it isn't. 2019-07-23 10:40:55 +00:00
uwe 4d25743b11 Prettify formatting. 2019-07-23 09:50:27 +00:00
sevan 26965a4a65 Use double dash to simulate em dash 2019-07-22 13:44:13 +00:00
sevan cef2b4ad5b Use \(em to get an emphasis dash 2019-07-22 13:37:37 +00:00
sevan a99bcdece4 Art for the masses - The Dream Machine
The text used an em dash which I've replaced with a coma here.
2019-07-22 09:47:28 +00:00
pgoyette a9c53af5cf Report the users score _after_ the game has ended and the screen has
been restored to pre-game state.  Otherwise, the user gets a message
that their score did (or more likely, did not) improve over their
previous score, yet the user has no indication of what the current
score actually was!
2019-03-19 00:11:34 +00:00
sevan 9c44dd6276 Shorter than a season - The Soul Of A New Machine 2019-02-24 12:34:00 +00:00
christos 7a986b99ab add fallthrough 2019-02-18 19:35:44 +00:00
mrg a5ca97c6e5 apply -Wno-error=implicit-fallthrough on files that have fallthru
comments but are missed by the current checker.
2019-02-04 09:51:47 +00:00
mrg 9c07d7ddd1 - done() can return in wizard mode. don't NOTREACHED'd it
but break instead.
2019-02-04 03:33:15 +00:00
mrg c543d06770 - 'cango' is used beyond a bool type. make it an int.
- add a couple of fallthru comments.
2019-02-04 03:29:41 +00:00
mrg 37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
mrg 770680b518 - avoid multipling a boolean value, use &&. 2019-02-03 10:45:58 +00:00
mrg fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
sevan f555b79219 Add Alfred North Whitehead quote. 2019-01-21 16:58:47 +00:00
jakllsch 6835f27c8d Incite the "Purple Cow" wrath of Gelett Burgess upon ourselves. 2019-01-13 17:55:03 +00:00
pgoyette 3b35ba0696 More appropriate line-wrapping for previous. 2018-12-15 22:00:16 +00:00
sevan 92d227ffa8 Some advice from Adam Savage / Alex Jason
https://www.reddit.com/r/mythbusters/comments/3wgqgv/the_origin_of_the_remember_kids_the_only/
2018-12-15 17:11:10 +00:00
sevan a2bcc5e795 Advice from Bob Morris
https://www.ieee-security.org/Cipher/ConfReports/conf-rep-Crypto95.html
2018-10-03 00:13:16 +00:00
sevan cf2901fc1a I've been on an Ed Wood binge. 2018-09-12 22:10:07 +00:00
maxv 782aa42924 replace ipf->npf 2018-09-02 16:08:12 +00:00
dholland 6f6568e389 typo 2018-08-25 19:38:37 +00:00
maya cdbb5491cb Try freebsd's pkg-info as well
From John Hein, via Nikolai Lifanov. PR misc/52684
2018-08-16 13:31:04 +00:00
mrg 240adcf578 fix the previous. the code was right, just badly formatted before.
should fix infinite loops reported in some cases.
2018-06-24 12:55:36 +00:00
kamil 1c426e1841 Restore the MKGROFF=bo MKCXX=yes build
Mark the documentation in dc(1), gprof(1), rogue(6) and fsck_ffs(8) with
the .roff flag in SUBDIR.

Sponsored by <The NetBSD Foundation>
2018-06-11 14:18:16 +00:00
christos 2357fc5dd5 use SUBDIR.roff suggested by uwe@ 2018-06-10 17:55:11 +00:00
snj 9e98533ad3 make fortune fatter 2018-05-08 05:24:22 +00:00
christos bf7113376a Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
2018-05-01 19:59:42 +00:00
eadler 31ce73e04a wtf(6): use character classes
ok pgoyette@ silence dholland@
2018-03-07 08:25:43 +00:00
eadler 7c4228cc00 wtf(6): quote "$f"
ok pgoyette@ silence dholland@
2018-03-07 08:24:16 +00:00
eadler 181c044ada [fish] don't allow users to request cards they have made books for
While here, don't re-renter pro mode

PR bin/52973

ok maya@ dh@
2018-03-05 04:59:54 +00:00
dholland 32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
christos 64a90adb69 fix for OpenSSL-1.1 2018-02-06 16:53:27 +00:00
mrg 31c4a0256f fix issues found by GCC 6.4:
battlestar was missing some {} in its insane printf()+puts() usage.
this is a literal code sequence i found:

	printf("The blast catches ");
	printf("the goddess in the ");
	printf("stomach, knocking ");
	puts("her to the ground.");
	printf("She writhes in the ");
	printf("dirt as the agony of ");
	puts("death taunts her.");
	puts("She has stopped moving.");

no lines inserted or removed.

tetris' checkscores() had wrong and missing {} usage.
2018-02-04 08:48:05 +00:00
christos 2429b427fa PR/52976: Eitan Adler: handle larger primes
Using results from
    J. Sorenson and J. Webster, Strong pseudoprimes to twelve prime
    bases, Math. Comp. 86(304):985-1003, 2017.
teach primes(6) to enumerate primes up to 2^64 - 1.  Until Sorenson
and Webster's paper, we did not know how many strong speudoprime tests
were required when testing alleged primes between 3825123056546413051
and 2^64 - 1.

Adapted from: FreeBSD
2018-02-03 15:40:29 +00:00
pgoyette 0a18c53300 Don't skip the superfluous "is" argument if it's not superfluous!
This allows us to use `wtf is` and get information for the acronym "is"
and produces the same output as `wtf is is` withough requiring the extra
typing by the user.
2018-01-17 03:03:59 +00:00
pgoyette fd80b85342 Neither bcd(6) nor morse(6) produce output containing slashes, and the
-d (decode) option works just fine with dashes.  :)
2018-01-16 06:43:53 +00:00
maya a3e52c510e Add _, from Eitan Adler in PR bin/52897 2018-01-16 06:20:24 +00:00
mlelstv 600397bd19 move offensive quotes per board@ 2017-12-13 21:11:27 +00:00
dholland d5efe6ddb1 attributions are supposed to be indented. 2017-12-06 17:54:58 +00:00
kamil 06124d1060 Correct code flow of a quote translation (by Tom Ivar Helbekkmo) 2017-12-06 17:41:15 +00:00
pgoyette b637bb2dc6 Fix typos, thanks to Tom Ivar Helbekkmo 2017-12-06 08:38:33 +00:00
kamil 17be8c5c9c Add new fortune entry with a quote from Jozef Pilsudski
This quote is a longer form of "the dogs bark, but the caravan goes on"
and compares Poles and Lithuanians (historical meanings used from the time
of country union of both nations).

Today is the 150th birthday anniversary of Jozef Pilsudski (1867-1935).
2017-12-05 22:51:59 +00:00
christos b4c11f4845 revert removals while there is an active discussion on what to do. 2017-11-19 01:31:53 +00:00
maya 655cfa70ec Remove a few offensive quotes, put in as many new quotes.
PR bin/52735
2017-11-18 20:48:50 +00:00
jnemeth 3cfc2a4194 add quote about libraries offending everyone 2017-11-18 19:51:46 +00:00
rin f345b5cb3f Add -h option to factor(6): duplicate factors are printed in
"human-readable" form of x^n.
2017-11-11 23:48:44 +00:00
joerg 1cb2a8c221 Include time.h for time. Drop sys/types.h and expect basic working
system headers.
2017-10-02 22:03:10 +00:00
dholland 6e9e9606f7 typo 2017-07-02 07:02:47 +00:00
dholland 495acf4f93 another one 2017-06-13 17:18:00 +00:00
leot d0e0e409e2 Permit Prof. Steven Falcon [sic] to play hals_end(6) (or, more
seriously: also permit games that contain underscores to be invoked
via wargames(6))
2017-05-21 16:47:26 +00:00
riastradh ef315f7931 Remove MKCRYPTO option.
Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export.  The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated.  I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S.  Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet...  That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.
2017-05-21 15:28:36 +00:00
dholland 824d8f0e42 a thing. 2017-05-04 19:12:53 +00:00
kamil 40a729ad22 Remove unmaintained link to imrryr from NetBSD specific fortune(6) entries
The original content is not accessible with the original link (missing
closing /). This page does not look to be updated since 2002 and artwork
is not freely reusable.
2017-04-16 20:08:59 +00:00
dholland 0d158d3a31 add somethign 2017-03-25 22:33:16 +00:00
christos 0fb210a2c1 elide compiler stupidity. 2017-03-20 22:05:27 +00:00
christos bb7174741f need time.h for time(), got side-loaded before from <fcntl.h> via <sys/stat.h> 2017-01-10 20:41:40 +00:00
christos fa60103ea6 ned stat.h 2017-01-10 20:40:53 +00:00
dholland ffc8219322 add a couple 2016-10-14 03:20:04 +00:00
kamil db4bd2c1ca Fix another place with a wrong author of "Unkempt Thoughts"
Stanislaw Lem -> Stanislaw J. Lec
2016-08-28 19:44:44 +00:00
kamil 111275b899 Correct the author of "Unkempt Thoughts" - it's Stanislaw Lec, not Lem
Pointed out by Antoni Grzymała <antoni@grzymala.info>

This mistake was in the sources since the beginning of this file in NetBSD.
2016-08-26 18:07:47 +00:00
dholland 71e42904ae add one 2016-07-15 06:13:50 +00:00
pgoyette a9be058835 Update entries for North and South Yemen, since the two countries were
united a long time ago (according to WikiPedia).

Thanks, wiz, for double-checking!
2016-06-28 09:27:26 +00:00
wiz 32b1c97b7e Fix typo. 2016-06-28 09:17:06 +00:00
pgoyette ce296c4c72 Missed one. 2016-06-28 00:16:57 +00:00
pgoyette 5be0c85005 Merge updates from PR bin/42576
XXX Any typos are mine, not those of the PR submitter!
2016-06-28 00:15:40 +00:00
dholland cbe436060d Do not pass usleep() values >= 1 million. From Henning Petersen in PR 51286 2016-06-27 08:46:04 +00:00
dholland c2f6e94e93 Double the threshold for crashing out with "too many words". 2016-06-25 23:15:41 +00:00
dholland c136a62a8b Fix the out-of-memory behavior so the message doesn't disappear under
endwin(). Related to PR 3126.
2016-06-12 02:15:26 +00:00
christos 5604b0c3c9 get rid of gets 2016-06-05 18:39:02 +00:00
dholland cde3d9a6b5 tetris(6) is not limited to CRT displays. noted by tnn 2016-03-12 03:14:59 +00:00
dholland d548b4af6b snake(6) supports LCD displays too. (noted by tnn) 2016-03-12 03:13:52 +00:00
nat ff18370b0b Center game board on screen. OK from christos@. 2016-03-03 21:38:55 +00:00
christos 099f03595b PR/50411: Rin Okuyama: fix two bugs:
- clear blocks in the 0 row, otherwise the pile up forever.
- black (white) blocks are not shown as "next shape":
2015-11-06 19:53:37 +00:00
dholland d1bc0cfc4f remove cpp abuse 2015-08-17 17:17:01 +00:00
wiz 66d1cd0cb5 Use An in AUTHORS section. 2015-07-26 22:22:24 +00:00
pgoyette f54820aed9 Sync descriptive text with actual game definition. 2015-07-23 01:19:20 +00:00
nat 305919e320 Fixes color scheme white on black and black on white.
This commit was approved by christos@
2015-07-07 22:53:25 +00:00
dholland 8d2578da11 add one 2015-06-27 08:07:46 +00:00
dholland 5dcb186afb Move game logic out of the file with the curses code. 2015-06-25 05:33:02 +00:00
dholland 01dcf47e23 Abolish the foul practice of including every header in existence via a
single central "include.h". Use only headers that are actually needed.
2015-06-19 06:02:31 +00:00
dholland cd1ecdeaa3 add -b to usage, from leot 2015-06-13 04:53:13 +00:00
dholland bf0b86145a Fix the list of keys across the bottom so it fits on an 80-column screen
again. Fixes PR 49937.

HI MRG
2015-06-13 04:15:51 +00:00
christos 6a960c88c2 PR/49850: Nikolai Lifanov: Document acronyms-o 2015-04-22 15:04:57 +00:00