Commit Graph

12 Commits

Author SHA1 Message Date
jsm 1fc5d09e80 Various improvements to parsing in battlestar, mostly from OpenBSD.
Define a constant WORDLEN.  Always use this constant and NWORD where
appropriate.

Use NWORD - 1 in battlestar.c to avoid off-by-one error.

Increment wordnumber after the INVEN verb to allow it to be followed
by a comma and other actions.

Avoid overflowing elements of the words array if input words are too
long.

Parse "," as AND except when followed by a verb, to allow such
constructions as "take foo, bar, and baz".  Trim AND AND which may
occur from the ", and" in such a list.

Avoid crashes from EVERYTHING in the wrong place by moving it to the
start of OBJECT AND EVERYTHING and NOUNS AND EVERYTHING sequences, and
trimming EVERYTHING AND EVERYTHING.
2000-09-21 17:44:34 +00:00
jsm af3dee978f Make code clearer; add a macro ROOMDESC for the number of times a room
should be visited for the short description only to be used, and don't
increment beenthere[position] beyond this value.  From OpenBSD.
2000-09-08 17:22:01 +00:00
mycroft f9eca6973d Use setgid(), not setregid(). 2000-05-08 07:55:59 +00:00
jsm 57b9dc499c Give sensible error message in a shouldn't happen case. 1999-09-18 16:40:04 +00:00
hubertf 6c243d931c This patch improves the handling of save files in battlestar(6), by
allowing the user to choose the name of the save file and specify it
on the command line when restoring.  It also eliminates a buffer
overrun in determining the path to the save file, and any particular
arbitrary limit on the name length.  In the name of a tidier home
directory, the default name is changed from "Bstar" to ".Bstar".

Patch supplied in PR 8085 by Joseph Myers <jsm28@cam.ac.uk>
Minor modification (s/startup/filename/ in initialize()) by me.
1999-07-28 01:45:41 +00:00
hubertf 054e79fedd Drop setgid privileges early. Derived from OpenBSD and sent in as PR 5970
by Joseph Myers <jsm28@cam.ac.uk>.
1999-07-21 03:56:53 +00:00
lukem 31c7a7bec5 KNFify (with indent) 1997-10-11 02:06:55 +00:00
lukem b6068ea04b WARNSify 1997-10-10 11:39:08 +00:00
tls 34cd8f5bdf Sync to 4.4BSD-Lite2 1997-01-07 11:56:32 +00:00
cgd 101657d110 clean up import 1995-03-21 15:03:38 +00:00
mycroft 8542364e07 Add RCS identifiers. 1993-08-01 18:49:50 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00