summaryrefslogtreecommitdiffstats
path: root/backgammon
diff options
context:
space:
mode:
authorfrueauf <frueauf@NetBSD.org>1998-09-15 13:43:34 +0000
committerfrueauf <frueauf@NetBSD.org>1998-09-15 13:43:34 +0000
commitc76c7a1e76aa07245fba38d91779b4488ff23932 (patch)
tree9e2e4fe9158f107b606de48a933c9bcbee51bc13 /backgammon
parent1a4377e3eab674eb0dea5754d260d93988f1151a (diff)
downloadbsdgames-darwin-c76c7a1e76aa07245fba38d91779b4488ff23932.tar.gz
bsdgames-darwin-c76c7a1e76aa07245fba38d91779b4488ff23932.tar.zst
bsdgames-darwin-c76c7a1e76aa07245fba38d91779b4488ff23932.zip
Fix args processing of backgammon and teachgammon, closes pr 5345 by
David Brownlee.
Diffstat (limited to 'backgammon')
-rw-r--r--backgammon/backgammon/main.c6
-rw-r--r--backgammon/common_source/subs.c6
-rw-r--r--backgammon/teachgammon/teach.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/backgammon/backgammon/main.c b/backgammon/backgammon/main.c
index 207c3c1b..e019c8df 100644
--- a/backgammon/backgammon/main.c
+++ b/backgammon/backgammon/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.7 1998/08/29 22:53:03 hubertf Exp $ */
+/* $NetBSD: main.c,v 1.8 1998/09/15 13:43:34 frueauf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.7 1998/08/29 22:53:03 hubertf Exp $");
+__RCSID("$NetBSD: main.c,v 1.8 1998/09/15 13:43:34 frueauf Exp $");
#endif
#endif /* not lint */
@@ -170,7 +170,7 @@ main(argc, argv)
if (yorn(0)) {
fixtty(&old); /* restore tty */
- execl(TEACH, "teachgammon", args, 0);
+ execl(TEACH, "teachgammon", args[0]?args:0, 0);
tflag = 0; /* error! */
writel(noteach);
diff --git a/backgammon/common_source/subs.c b/backgammon/common_source/subs.c
index e1017713..95375f8c 100644
--- a/backgammon/common_source/subs.c
+++ b/backgammon/common_source/subs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: subs.c,v 1.8 1998/09/13 15:19:35 hubertf Exp $ */
+/* $NetBSD: subs.c,v 1.9 1998/09/15 13:43:35 frueauf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)subs.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: subs.c,v 1.8 1998/09/13 15:19:35 hubertf Exp $");
+__RCSID("$NetBSD: subs.c,v 1.9 1998/09/15 13:43:35 frueauf Exp $");
#endif
#endif /* not lint */
@@ -324,7 +324,7 @@ getarg(arg)
* the game is being recovered */
s = *arg;
- while (s[0][0] == '-') {
+ while (*s && s[0][0] == '-') {
switch (s[0][1]) {
/* don't ask if rules or instructions needed */
diff --git a/backgammon/teachgammon/teach.c b/backgammon/teachgammon/teach.c
index 8a0089a7..146f4a72 100644
--- a/backgammon/teachgammon/teach.c
+++ b/backgammon/teachgammon/teach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: teach.c,v 1.6 1998/08/29 22:53:04 hubertf Exp $ */
+/* $NetBSD: teach.c,v 1.7 1998/09/15 13:43:35 frueauf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: teach.c,v 1.6 1998/08/29 22:53:04 hubertf Exp $");
+__RCSID("$NetBSD: teach.c,v 1.7 1998/09/15 13:43:35 frueauf Exp $");
#endif
#endif /* not lint */
@@ -155,7 +155,7 @@ leave()
else
writec('\n');
fixtty(&old);
- execl(EXEC, "backgammon", args, "n", 0);
+ execl(EXEC, "backgammon", "-n", args[0]?args:0, 0);
writel("Help! Backgammon program is missing\007!!\n");
exit(-1);
}