Commit Graph

10 Commits

Author SHA1 Message Date
jsm
572a824811 Discard any part of a line of input that goes beyond our buffer rather
than treating it as our next line of input.  From OpenBSD.
2000-09-24 15:51:40 +00:00
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
16d8e9af6f die() on EOF; based on OpenBSD. 2000-09-21 09:49:03 +00:00
jsm
819ea9d1a6 Clean up formatting; partly from OpenBSD. 2000-09-17 23:04:17 +00:00
hubertf
bd8be7848a Const poisoning, per PR 6660 by Joseph Myers <jsm28@cam.ac.uk> 1999-02-10 01:36:50 +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
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