1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
Commit Graph

1375 Commits

Author SHA1 Message Date
miod
43d0313fbb Feed more generated files to the clean target; joint work with naddy@ 2024-02-08 20:28:53 +00:00
tb
aa41ab081c Fix format string warning in robots/score.c 2023-10-10 09:48:06 +00:00
tb
e64b3f63c7 Print a long with %ld instead of %d 2023-10-10 09:43:52 +00:00
tb
9aab49f6d1 Use vw_printw() and fix a format print warning. 2023-10-10 09:42:56 +00:00
tb
f91c735ec8 Print non-literal string with "%s"
Caught by printf format attribute for printw(3) in newer curses.
2023-10-10 08:22:19 +00:00
jsg
25fdf8020c remove uneeded function decls
ok tb@
2023-09-06 11:53:56 +00:00
op
77f90040a1 drop `uptodate()' check from hack(6)
hack(6) scrapes $PATH to find its executable and compare the mtime to
the save file and bone file.  If the game is newer than those, they're
not loaded.

Drop this feature.  /usr/games is not in the default $PATH anymore, and
the format for those file didn't change since the import.

Diff from Anton Konyahin (me [at] konyahin [dot] xyz)
2023-06-03 15:19:38 +00:00
tb
bda95cca51 Convert K&R function definition to ansi to make clang 15 happier 2023-05-05 10:26:50 +00:00
jmc
3f917409fa this morning's fortune was missing an apostrophe; 2023-03-08 07:02:09 +00:00
miod
3fc45b72fb Put explicit ULL suffix to constants which won't fit in 32 bits. 2023-02-18 08:52:39 +00:00
jsg
893695cea0 Christos Zoulas agreed to rescind clause 3 and 4 in
NetBSD fsck.8 rev 1.35 fsutil.h rev 1.14 pathnames.h rev 1.2
netgroup_mkdb.8 rev 1.9 netgroup_mkdb.c rev 1.18 str.c rev 1.7
str.h rev 1.4 rdate.8 rev 1.11 rdate.c rev 1.19 extern.h rev 1.14
getnetgrent.c rev 1.41 netgroup.h rev 1.10
fparseln.3 rev 1.4 fparseln.c rev 1.10

our stringlist.c/stringlist.h are derived from getnetgrent.c
rfc868time.c from rdate.c
newfs/pathnames.h from fsck/pathnames.h

https://mail-index.netbsd.org/source-changes/2009/10/21/msg002182.html
Not all files are covered as some had copyright assigned to TNF in 1998.
2023-01-04 13:00:11 +00:00
daniel
126bb2a7ff add Czechia as an alternative for Czech Republic 2022-12-18 18:02:00 +00:00
cheloha
d7259957e8 userspace: remove vestigial '?' cases from top-level getopt(3) loops
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.  Hence, remove all the redundant "case '?':" lines.

Prompted by dlg@.  With help from dlg@ and millert@.

Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2

ok naddy@ millert@ dlg@
2022-12-04 23:50:45 +00:00
deraadt
e99802964e typing ^C and seeing "terminated by signal %d" is so ... I don't
have the words
ok florian
2022-09-27 03:01:42 +00:00
florian
9121950209 There are time zones that have minute offsets, display those
correctly. Pointed out by pjanzen@.
To display the offset, use ISO 8601, as suggested by David Goerger.

While here check if tm->tm_gmtoff changed which probably means that we
moved in or out of daylight savings time.

Input & OK millert, deraadt
2022-09-24 16:07:26 +00:00
florian
94089c8a8f Show time zone name and offset in clock border if TZ environment
variable is set. This is useful when running multiple clocks in
different time zones.
From James Russell Stickney (jrs AT outband.net), tweaked by me.
Input & OK kn
2022-09-17 10:32:05 +00:00
tb
534f87a39f Rework random(6)
Fix putchar(3) handling and a number of other issues in the random(6)
code. In -e mode, avoid bias due to truncation of the return code to
8 bits. In default mode, actually treat the denominator as a floating
point number and print the line with a probability of 1 / denominator.
This allows e.g. printing 2/3 of stdin with 'random 1.5'.

Includes code for uniform random floats by Taylor R. Campbell from
https://mumble.net/~campbell/2014/04/28/uniform-random-float
and clz64() by me.

From lucic71 () bronze ! ctrl-c ! club, thanks.

ok deraadt
2022-08-23 06:35:53 +00:00
op
f3c231593a switch fgetln remnants to getline. ok millert@ 2022-08-08 17:57:05 +00:00
op
9e6678dc8f fully switch quiz(6) to getline; diff from Ben Fuller (ben [at] bvnf
space), ok millert@
2022-08-08 17:54:08 +00:00
jsg
6e23b9dc8d change some 4.4BSD references to earlier releases
ok schwarze@
2022-08-04 06:20:24 +00:00
daniel
ac81be68d2 remove the "tbl" suffix for a few man pages
Over a decade ago, the build infrastructure had special logic to process
man pages that ended with the suffix "tbl".

This infrastructure is long gone and the special naming for these man pages
is no longer needed.

Revert the naming of these man pages for consistency with all other man
pages in the tree. As a bonus, we remove a few lines from some of the
Makefiles making them simpler.

ok jmc@, and no objection from schwarze@
2022-07-11 03:11:49 +00:00
daniel
0fde2ccbdd update countres and capitals in quiz(6)
Changes:
- update country and capital names that have changed in recent years
- remove the formal prefix from South Africa for consistency with other
  country names
- add additional capitals for countries with multiple capitals
- add "The" as optional prefix for The Gambia and The Bahamas
- add missing suffix "City" to a few capitals
- add many missing countries

NetBSD appears to have also added territories which I've not added in this
update.

The removal of The Hague for The Netherlands was taken from NetBSD and
confirmed by otto@

The duplicate Turkey and Georgia entries have not been touched.

Prompted by a diff by Ben Fuller, who also provided much helpful feedback.
2022-07-06 02:09:05 +00:00
naddy
41ce3b17e7 man pages: add missing commas between subordinate and main clauses
jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@
2022-03-31 17:27:13 +00:00
jsg
25a24f0b58 Avoid gendered language in man pages when not referring to a specific
person. Rewrite or use singular they.

ok thfr@ sthen@ daniel@ ian@ job@ kmos@ jcs@ ratchov@ phessler@ and
others I'm likely missing on an earlier version.
feedback tj@, feedback and ok jmc@
2022-02-18 23:17:13 +00:00
jsg
d905fc10a3 prefer https links in man pages
ok gnezdo@ miod@ jmc@
2022-02-18 10:24:32 +00:00
gnezdo
4f2e04b490 Fix UB "shift-out-of-bounds" in battlestar
OK millert@
2022-02-05 23:00:20 +00:00
tb
b5a76aaea7 Filter out all symbols starting with a double underbar. In particular,
this filters out all retguard symbols, which are no fun to guess. One
recognizes them easily but can get yourself hanged by a single digit!

An earlier version filtering only __retguard symbols was

ok deraadt, jsing

guenther agreed that filtering all double underbar symbols makes sense.
He also suggested to filter out symbols containing several consecutive
digits, but how much fun is guessing libcrypto symbols without all the
X509 goodness?
2021-12-24 23:01:56 +00:00
deraadt
361380a1a5 The PATH_MAX+1 bites. The PATH_MAX+1 bites. You die...
ok millert mlarkin
2021-12-15 16:29:29 +00:00
jmc
cd5636cd1f since it's unlikely that i'll get away with changing fortune's real usage to
the string below (unfortunately), settle for making it more realistic: Usage->usage

  -Usage: fortune -P [] -a [xsz] [Q: [file]] [rKe9] -v6[+] dataspec ... inputdir
  +usage: fortune -P [] -a [xsz] [Q: [file]] [rKe9] -v6[+] dataspec ... inputdir
2021-11-20 19:15:55 +00:00
mestre
16dd490345 missed in previous commit
this was ok tb@
2021-10-23 15:08:26 +00:00
mestre
bda84ce940 if both stdout and stderr are redirected to a non-tty, pledge(2) will kill
ncurses applications, e.g.:

/usr/games/worms 2>&1 | cat

solve this by only calling pledge(2) after initscr(3) is set and done, or
whatever function that calls it. since pledge(2) is called later now the
promises might be reduced, but this a diff for another day.

found by naddy@ almost a year ago, discussed with him deraadt@ and tb@
ok tb@
2021-10-23 11:22:48 +00:00
jmc
d8feb385f8 - guiness -> guinness
- heros -> heroes
- kill a dup

from tom
2021-08-24 20:04:28 +00:00
jmc
01ef4bc58a vini vidi vici -> veni vidi vici 2021-08-24 13:16:07 +00:00
beck
bc5a8259a4 Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@
2021-07-12 15:09:18 +00:00
millert
8a56d9bbcf Remove extraneous for() likely caused by copy & paste.
From trondd, OK pjanzen@
2021-04-29 01:57:00 +00:00
naddy
5a0076c3c8 quiz: handle line continuation in data files correctly, switch to getline(3)
Specifically, the following quiz.db line

foo:\
bar

was parsed into "foo:bar\n", which made it impossible to answer correctly.

Bug reported and inital fix from Alex Karle, partially reworked by
yours truly, further input from millert@
2021-03-11 21:18:25 +00:00
jsg
093fc5b92d Add some references, most of these were removed when we stopped building
and installing USD/SMM/PSD docs.

jmc@ agrees with the direction, ok millert@ on an earlier diff
2021-03-08 02:47:25 +00:00
tb
8613de63bb Fix intercardinal directions in hack help.
From Raf Czlonka
2021-03-07 17:08:49 +00:00
mestre
9edb0cbec1 while learning (teachgammon(1)) you might want to save your game so "{w,c}path"
pledge(2) permissions are required
2021-02-06 21:42:30 +00:00
deraadt
d0bb67025f satisfy -fno-common by duplicating deck chairs as required
ok mortimer millert
2021-01-27 01:59:39 +00:00
deraadt
9cf65994f1 satisfy -fno-common
similar to the approach used by mortimer
2021-01-27 01:57:37 +00:00
millert
46c6838e68 Fix build with -fno-common. OK deraadt@ 2021-01-26 20:42:49 +00:00
millert
a6d654780e Ignore special keys returned by the curses getch() function.
Prevents canfield from suspending itself when you resize the window.
Canfield is not prepared to deal with anything other than normal
characters so just ignore them.  OK tb@ pjanzen@
2021-01-21 20:08:17 +00:00
jmc
d075035988 some updates from pjanzen; 2021-01-21 07:12:34 +00:00
schwarze
e8326ca2c6 add the missing EXIT STATUS and HISTORY sections 2021-01-03 01:41:51 +00:00
schwarze
c3f0a71bac Obvious bugfix: requesting a long dictum from a file containing short
ones only or vice versa is an error rather than a recipe for success.
2021-01-03 01:32:13 +00:00
schwarze
6e88d42dcd fix inverted exit status of fortune -m;
bug reported and patch provided
by Tilo Stritzky <lfsdc at gmx dot de> on bugs@;
OK martijn@
2021-01-02 21:35:11 +00:00
zhuk
cb8ad17457 Avoid NULL dereference after returning from copy().
okay martijn@
2020-12-15 14:06:32 +00:00
daniel
166ddc28d1 the names com1 to com9 are reserved filenames on windows
Rename these files in the same way as NetBSD did in 2001. Requested by
John Carmack so OpenBSD source code can be checked out on Windows.

ok deraadt@, sthen@, "go ahead" jsg@
2020-12-15 00:38:18 +00:00
jmc
cbe702d0ae fix unmarked/ignored descriptive mix up;
from rafa
2020-12-13 15:47:32 +00:00