-/* $NetBSD: fish.c,v 1.21 2011/08/31 16:24:55 plunky Exp $ */
+/* $NetBSD: fish.c,v 1.23 2018/03/05 04:59:54 eadler Exp $ */
/*-
* Copyright (c) 1990, 1993
#if 0
static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fish.c,v 1.21 2011/08/31 16:24:55 plunky Exp $");
+__RCSID("$NetBSD: fish.c,v 1.23 2018/03/05 04:59:54 eadler Exp $");
#endif
#endif /* not lint */
continue;
}
buf[strlen(buf) - 1] = '\0';
- if (!strcasecmp(buf, "p") && !promode) {
- promode = 1;
- (void)printf("Entering pro mode.\n");
+ if (!strcasecmp(buf, "p")) {
+ if (!promode) {
+ promode = 1;
+ printf("Entering pro mode.\n");
+ }
+ else {
+ printf("Already in pro mode.\n");
+ }
continue;
}
if (!strcasecmp(buf, "quit"))
continue;
}
n = p - cards;
- if (userhand[n]) {
+ if (userhand[n] <= 3) {
userasked[n] = 1;
return(n);
}
+ if (userhand[n] == 4) {
+ printf("You already have all of those.\n");
+ continue;
+ }
+
if (nrandom(3) == 1)
(void)printf("You don't have any of those!\n");
else
err(1, "open %s", _PATH_INSTR);
if (dup2(fd, 0) == -1)
err(1, "dup2");
- (void)execl("/bin/sh", "sh", "-c", pager, NULL);
+ (void)execl("/bin/sh", "sh", "-c", pager, (char *) NULL);
err(1, "exec sh -c %s", pager);
/*NOTREACHED*/
case -1: