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.
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.
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
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.
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.
Eliminate some frequently occurring subexpressions during substitution.
No functional change, assuming that fortune(6) always spits out less
than 2 gigacharacters of text.
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.
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.
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>
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.
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@.
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.
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@
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@
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."
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.
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!
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
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.
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
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.
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).
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.htmlhttps://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.htmlhttps://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.
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.