1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 15:23:33 +02:00
Commit Graph

126 Commits

Author SHA1 Message Date
deraadt db52001621 file not needed 2024-08-19 01:04:10 +00:00
deraadt eee238c66d spelling error, fixed by "snj", 21 years ago in some other repository 2024-08-19 01:03:12 +00:00
jsg ce7279d89b remove prototypes with no matching function and externs with no var
partly checked by millert@
2024-05-21 05:00:47 +00:00
miod 43d0313fbb Feed more generated files to the clean target; joint work with naddy@ 2024-02-08 20:28:53 +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
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
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
tb 8613de63bb Fix intercardinal directions in hack help.
From Raf Czlonka
2021-03-07 17:08:49 +00:00
millert 46c6838e68 Fix build with -fno-common. OK deraadt@ 2021-01-26 20:42:49 +00:00
deraadt df69c215c7 When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
2019-06-28 13:32:41 +00:00
jmc 75bcd186ff macro args and punctuation should be space spearated;
from fabio scotoni
2019-04-08 17:49:07 +00:00
bentley dc14b708bc Fix hack(6).
- Write savegames and scorefiles to the current directory instead of /var
- Save oc_name and oc_descr alongside oc_uname in all situations
- When a levitation potion times out, explicitly float down

These patches were contributed last year by "tonypony76"; thanks!

ok deraadt@, with added enthusiasm from tedu@
2019-04-05 09:02:27 +00:00
mestre b9f1292116 Remove a few too early pledge(2)s on games/ and apply them a little bit later
but with much reduced permissions ("stdio tty" if ncurses based and "stdio"
for the ones that only perform basic operations).

There's still a few games that we cannot yet remove their fs access, through
pledge(2), since they open files on demand and too late, this might get
revisited in the future.

OK tb@
2018-08-24 11:14:49 +00:00
espie 2b34b792e5 remove misc. depend and yacc nits that no longer matter.
okay millert@
2017-07-10 21:30:37 +00:00
espie 9410ab6b62 missed BUILDFIRST. Allow stuff to proceed without depends
as found by krw@
2017-07-01 14:37:25 +00:00
akfaew 8733d36ff9 Fix a path in Makequest and remove hack.sh (it never worked).
OK tb@
2017-06-20 20:40:54 +00:00
gsoares dc90561245 snprintf() format string should be literal
avoid compiler silly warnings

sure deraadt@
2017-04-08 22:59:09 +00:00
tb ee7acb09aa Callers of time(3) should #include <time.h>.
ok deraadt
2016-09-11 14:21:17 +00:00
tb e5fbd3ce79 These games have been broken for the better part of a year, ever since
their setgid bits got removed.  Mark them as such in their manuals.

ok deraadt, help with wording jmc
2016-09-09 15:32:28 +00:00
mestre 45555366a8 Prefer fseek(3) over rewind(3) since the latter although it also calls fseek
then additionally it calls clearerr(3) deliberately but we want to catch any
error that may happen and this way we couldn't catch it

OK tb@
2016-03-16 15:00:35 +00:00
mestre 64f0fa1112 execl(3) calls must have the last argument casted to (char *)NULL
At the time when this was commited me and tb@ discussed that it shouldn't be
changed, but still snucked in within a larger diff that we didn't notice.

OK tb@
2016-03-15 19:56:20 +00:00
mestre 8ae737b14e #ifdef QUEST then a few functions won't work, because of that include
<stdlib.h> if we are on a QUEST

OK tb@
2016-01-10 15:12:20 +00:00
mestre 6acf840eb1 Remove several casts to (char *) 0 and replace them by NULL
Prompted and OK by tb@
2016-01-09 21:54:11 +00:00
mestre aed906e4b2 This diff is rather large, but it's just simply removing unnecessary headers
, remove some lint-style comments, add missing void to functions without args,
also some function prototypes (extern) were missing their args, so I added them
as they were defined in hack.h

OK tb@ on separate diffs
2016-01-09 18:33:15 +00:00
millert 7146b7ce3e hack expects to be able to read ^Z as a normal character so disable
SUSP in the termios settings.  Presumably this is how things worked
before the conversion to termios.  Fixes suspend/resume in hack.
2016-01-07 18:25:52 +00:00
tb 17641e3181 Some basic code maintenance in games/
- in main() replace exit with return
- drop some /* NOTREACHED */ lint comments along the way.
- make more use of standard CFLAGS, esp. -Wimplicit-function-declaration
- add and sort some headers when needed
- add straightforward pledges to some programs used at compile time

discussed with and ok mestre@
2016-01-07 16:00:31 +00:00
mestre 7ad55f5581 Set as __dead a few more functions, that don't return, on games/
With precious tip, help and also OK from tb@
2015-12-26 00:26:39 +00:00
tb 466e81dfe1 Use __progname instead of hand-rolled parsing of argv[0].
Inspired by similar diffs by tobias@ and millert@.

"I like the concept" pjanzen@
ok tedu@
2015-12-16 14:21:50 +00:00
tb 23d7e0c886 add missing #include "hack.h" 2015-12-05 13:37:43 +00:00
schwarze d6d428c736 delete useless BUGS section; patch from Jan Stary <hans at stare dot cz> 2015-11-30 16:53:39 +00:00
deraadt ebb0af75bc In 1995, all of the games were setuid games. At end of 1996, I took them all
to setgid games, and we started wittling them down.  Nearly 10 years later I
am removing all setgid from the games.  If any of these have score files they
are now broken, and I hope various folk repair them.  I have argued for years
(and received pushback...) that the score file features must be removed, or
rewritten to use private files, because setgid is the wrong tool.
ok tedu
2015-11-24 03:10:09 +00:00
deraadt f24baa2d48 creat() -> open equiv; from Frederic Nowak 2015-11-11 01:12:09 +00:00
tedu 33206277fe replace setbuf with setvbuf, from Frederic Nowak 2015-11-04 21:22:10 +00:00
mmcc cb40a3d352 Cast ctype functions' argument to unsigned char.
ok guenther@
2015-10-24 18:49:39 +00:00
mmcc 5eb74ca34f Cast ctype functions' arguments to unsigned char.
ok guenther@
2015-10-24 18:26:13 +00:00
mmcc e6743bfe73 Cast isdigit()'s argument to unsigned char.
ok guenther@
2015-10-24 17:56:42 +00:00
mmcc 8a7637b1dd Cast ctype functions' arguments to unsigned char.
ok guenther@
2015-10-24 17:43:28 +00:00
mmcc 8a97e63eab Cast ctype functions' arguments to unsigned char.
ok guenther@
2015-10-24 17:40:38 +00:00
mmcc a0a49686e0 Cast isdigit()'s argument to unsigned char.
ok guenther@
2015-10-24 17:37:56 +00:00
tobias 2f95621a47 Disable !-command to escape to a shell. You are supposed to play, press
^Z, or open up another terminal if there is something else to do.

ok deraadt
2015-10-16 07:37:46 +00:00
guenther 911134d294 Annotate funcs with __attribute__((printf(...))) and clean up the fallout:
* lots of foo(str) --> foo("%s", str) transformations
 * one totally insane foo(fmt, ap) --> vfoo(fmt, ap) conversion: how did
   this ever work?
 * prefer const char[] over char* for static format strings, as it lets
   gcc check the format and eliminates an unnecessary pointer

ok beck@
2015-09-27 05:13:11 +00:00
jmc 0870f47d28 remove the first comma from constructs like ", and," and ", or,": you can use
"and" and "or" to join sentence clauses, and you can use commas, but both hinders
reading;
2015-03-13 19:58:40 +00:00
krw 5f1af72573 Make some $OpenBSD$ lines prettier/standardier by eliminating
superflous '*' after '/*' and adding blank after terminating '$'.
Also eases parsing of the lines by simple awk scripts.

Aesthetic approval from tedu@.
2015-01-19 15:30:52 +00:00
deraadt 0afc0f96b3 all modern systems can do this SUSPEND thing 2015-01-15 17:14:04 +00:00
deraadt e432a80783 NR_OF_EOFS is a festering boil, lance & drain.
ok millert
2015-01-15 17:13:37 +00:00
deraadt f84032eda8 For now, these games still contain deterministic randomization (for
save / replay modes of operation that have not yet been cleaned up).
OK, I've let the cat out of the bag, now some of you know you can cheat
at them..
ok millert guenther tedu
2014-12-08 21:56:27 +00:00
guenther 34278d36bd Eliminate pointless use of <sys/param.h>, <sys/file.h>, <sys/sockio.h>,
and <sys/ttydefaults.h>
Replace MAXPATHLEN with PATH_MAX and MAXLOGNAME with LOGIN_NAME_MAX
Pull in <limits.h> where needed
Prefer sizeof(var) over MAXFOO or FOO_MAX

ok deraadt@
2014-11-16 04:49:48 +00:00
schwarze 27e959701b obvious cases of missing .An;
found with the new mandoc(1) MANDOCERR_AN_MISSING warning;
no text changes
2014-09-08 01:27:54 +00:00
guenther ebf3d589a8 Match bwrite()'s prototype with write()'s, zapping a lint comment
Delete casts to char* of arguments to bwrite() and free()
2014-03-11 08:05:15 +00:00