diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 2000-09-26 04:42:57 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 2000-09-26 04:42:57 +0000 |
commit | 081be079b82a2b9dcf1d7c705032e009184290b4 (patch) | |
tree | 7ec64cfd94c4f374f423a2d1639f6ed60b6ea28a /games/battlestar/getcom.c | |
parent | 1b52f89e205c620c377b41287725ba817dcd34bb (diff) |
Improve handling of multiple commands on one line. Tidy fight parser.
Handle "all" in one place (almost). Add AUXVERB category and OBJ_PERSON/
OBJ_NONOBJ flags. Most was discussed with jsm@netbsd.org, and some is from
him.
Diffstat (limited to 'games/battlestar/getcom.c')
-rw-r--r-- | games/battlestar/getcom.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/games/battlestar/getcom.c b/games/battlestar/getcom.c index 9da57cbaaf0..44297849c00 100644 --- a/games/battlestar/getcom.c +++ b/games/battlestar/getcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getcom.c,v 1.9 2000/09/24 21:55:25 pjanzen Exp $ */ +/* $OpenBSD: getcom.c,v 1.10 2000/09/26 04:42:56 pjanzen Exp $ */ /* $NetBSD: getcom.c,v 1.3 1995/03/21 15:07:30 cgd Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)getcom.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: getcom.c,v 1.9 2000/09/24 21:55:25 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: getcom.c,v 1.10 2000/09/26 04:42:56 pjanzen Exp $"; #endif #endif /* not lint */ @@ -89,12 +89,13 @@ getword(buf1, buf2, flag) cnt = 1; while (isspace(*buf1)) buf1++; - if (*buf1 != ',') { + if (*buf1 != ',' && *buf1 != '.') { if (!*buf1) { - *buf2 = 0; + *buf2 = '\0'; return (0); } - while (cnt < WORDLEN && *buf1 && !isspace(*buf1) && *buf1 != ',') + while (cnt < WORDLEN && *buf1 && !isspace(*buf1) && + *buf1 != ',' && *buf1 != '.') if (flag < 0) { if (isupper(*buf1)) { *buf2++ = tolower(*buf1++); |