summaryrefslogtreecommitdiffstats
path: root/backgammon/teachgammon/teach.c
diff options
context:
space:
mode:
Diffstat (limited to 'backgammon/teachgammon/teach.c')
-rw-r--r--backgammon/teachgammon/teach.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/backgammon/teachgammon/teach.c b/backgammon/teachgammon/teach.c
index 9d10908d..7559f5ad 100644
--- a/backgammon/teachgammon/teach.c
+++ b/backgammon/teachgammon/teach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: teach.c,v 1.21 2010/03/22 05:10:19 mrg Exp $ */
+/* $NetBSD: teach.c,v 1.22 2012/10/13 19:19:39 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\
#if 0
static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: teach.c,v 1.21 2010/03/22 05:10:19 mrg Exp $");
+__RCSID("$NetBSD: teach.c,v 1.22 2012/10/13 19:19:39 dholland Exp $");
#endif
#endif /* not lint */
@@ -63,6 +63,7 @@ int
main(int argc __unused, char *argv[])
{
int i;
+ struct move mmstore, *mm;
/* revoke setgid privileges */
setgid(getgid());
@@ -76,12 +77,16 @@ main(int argc __unused, char *argv[])
raw.c_lflag &= ~ICANON; /* set up modes */
ospeed = cfgetospeed(&old); /* for termlib */
tflag = getcaps(getenv("TERM"));
+
+ /* need this now beceause getarg() may try to load a game */
+ mm = &mmstore;
+ move_init(mm);
#ifdef V7
while (*++argv != 0)
#else
while (*++argv != -1)
#endif
- getarg(&argv);
+ getarg(mm, &argv);
if (tflag) {
noech.c_oflag &= ~(ONLCR | OXTABS);
raw.c_oflag &= ~(ONLCR | OXTABS);
@@ -137,7 +142,7 @@ main(int argc __unused, char *argv[])
if ((i = wrtext(lastch)) != 0)
break;
}
- tutor();
+ tutor(mm);
/* NOTREACHED */
return (0);
}