1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-18 05:36:16 +02:00
openwrt-packages/bsd-games/patches/004-backgammon.patch
kyak 7495f45494 backgammon won't fail miserably on small terminals
Still need to launch via backgammon.sh, because at least 57x24 term is
needed for correct playing. At least it won't segfault on smaller
terminals.
2011-02-15 13:44:52 +03:00

439 lines
13 KiB
Diff

diff -ur bsd-games-2.17/backgammon/backgammon/extra.c bsd-games-2.17-p/backgammon/backgammon/extra.c
--- bsd-games-2.17/backgammon/backgammon/extra.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/backgammon/extra.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)extra.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: extra.c,v 1.5 2003/08/07 09:36:55 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
#include "backlocal.h"
diff -ur bsd-games-2.17/backgammon/backgammon/main.c bsd-games-2.17-p/backgammon/backgammon/main.c
--- bsd-games-2.17/backgammon/backgammon/main.c 2005-02-16 09:24:50.000000000 +0300
+++ bsd-games-2.17-p/backgammon/backgammon/main.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,18 +30,18 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n");
-#endif /* not lint */
+#endif */ /* not lint */
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: main.c,v 1.21 2005/02/15 12:56:20 jsm Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include <time.h>
@@ -49,6 +49,7 @@
#include "backlocal.h"
#define MVPAUSE 5 /* time to sleep when stuck */
+#define OXTABS XTABS
extern const char *const instr[]; /* text of instructions */
extern const char *const message[]; /* update message */
@@ -124,7 +125,7 @@
#ifdef V7
while (*++argv != 0) /* process arguments */
#else
- while (*++argv != -1) /* process arguments */
+ while (*++argv != 0) /* process arguments */
#endif
getarg(&argv);
args[acnt] = '\0';
diff -ur bsd-games-2.17/backgammon/backgammon/move.c bsd-games-2.17-p/backgammon/backgammon/move.c
--- bsd-games-2.17/backgammon/backgammon/move.c 2004-01-27 23:52:07.000000000 +0300
+++ bsd-games-2.17-p/backgammon/backgammon/move.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: move.c,v 1.8 2004/01/27 20:30:28 jsm Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
#include "backlocal.h"
diff -ur bsd-games-2.17/backgammon/backgammon/text.c bsd-games-2.17-p/backgammon/backgammon/text.c
--- bsd-games-2.17/backgammon/backgammon/text.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/backgammon/text.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)text.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: text.c,v 1.7 2003/08/07 09:36:56 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
diff -ur bsd-games-2.17/backgammon/backgammon/version.c bsd-games-2.17-p/backgammon/backgammon/version.c
--- bsd-games-2.17/backgammon/backgammon/version.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/backgammon/version.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)version.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: version.c,v 1.6 2003/08/07 09:36:56 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
const char *const message[] = {
"Last updated on Friday, October 10, 1997.",
diff -ur bsd-games-2.17/backgammon/common_source/allow.c bsd-games-2.17-p/backgammon/common_source/allow.c
--- bsd-games-2.17/backgammon/common_source/allow.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/common_source/allow.c 2011-02-15 11:22:28.989059790 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)allow.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: allow.c,v 1.5 2003/08/07 09:36:56 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
diff -ur bsd-games-2.17/backgammon/common_source/board.c bsd-games-2.17-p/backgammon/common_source/board.c
--- bsd-games-2.17/backgammon/common_source/board.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/common_source/board.c 2011-02-15 11:22:28.989059790 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)board.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: board.c,v 1.7 2003/08/07 09:36:57 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
diff -ur bsd-games-2.17/backgammon/common_source/check.c bsd-games-2.17-p/backgammon/common_source/check.c
--- bsd-games-2.17/backgammon/common_source/check.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/common_source/check.c 2011-02-15 11:22:28.989059790 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)check.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: check.c,v 1.5 2003/08/07 09:36:57 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
diff -ur bsd-games-2.17/backgammon/common_source/fancy.c bsd-games-2.17-p/backgammon/common_source/fancy.c
--- bsd-games-2.17/backgammon/common_source/fancy.c 2004-04-24 20:13:09.000000000 +0400
+++ bsd-games-2.17-p/backgammon/common_source/fancy.c 2011-02-15 11:22:28.989059790 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)fancy.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: fancy.c,v 1.12 2004/04/23 02:58:27 simonb Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
@@ -726,7 +726,7 @@
lUP = strlen(UP);
if (ND)
lND = strlen(ND);
- if (LI < 24 || CO < 72 || !(CL && UP && ND))
+ if (LI < 20 || CO < 52 || !(CL && UP && ND))
return (0);
linect = (int *) calloc(LI + 1, sizeof(int));
if (linect == NULL) {
diff -ur bsd-games-2.17/backgammon/common_source/init.c bsd-games-2.17-p/backgammon/common_source/init.c
--- bsd-games-2.17/backgammon/common_source/init.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/common_source/init.c 2011-02-15 11:22:28.989059790 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: init.c,v 1.8 2003/08/07 09:36:57 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include <termios.h>
diff -ur bsd-games-2.17/backgammon/common_source/odds.c bsd-games-2.17-p/backgammon/common_source/odds.c
--- bsd-games-2.17/backgammon/common_source/odds.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/common_source/odds.c 2011-02-15 11:22:28.989059790 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)odds.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: odds.c,v 1.5 2003/08/07 09:36:57 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
diff -ur bsd-games-2.17/backgammon/common_source/one.c bsd-games-2.17-p/backgammon/common_source/one.c
--- bsd-games-2.17/backgammon/common_source/one.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/common_source/one.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)one.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: one.c,v 1.5 2003/08/07 09:36:57 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
diff -ur bsd-games-2.17/backgammon/common_source/save.c bsd-games-2.17-p/backgammon/common_source/save.c
--- bsd-games-2.17/backgammon/common_source/save.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/common_source/save.c 2011-02-15 11:22:28.989059790 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: save.c,v 1.10 2003/08/07 09:36:57 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include <errno.h>
diff -ur bsd-games-2.17/backgammon/common_source/subs.c bsd-games-2.17-p/backgammon/common_source/subs.c
--- bsd-games-2.17/backgammon/common_source/subs.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/common_source/subs.c 2011-02-15 11:22:28.989059790 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)subs.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: subs.c,v 1.14 2003/08/07 09:36:57 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
diff -ur bsd-games-2.17/backgammon/common_source/table.c bsd-games-2.17-p/backgammon/common_source/table.c
--- bsd-games-2.17/backgammon/common_source/table.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/common_source/table.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/* #ifndef lint
#if 0
static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: table.c,v 1.7 2003/08/07 09:36:57 agc Exp $");
#endif
-#endif /* not lint */
+#endif */ /* not lint */
#include "back.h"
diff -ur bsd-games-2.17/backgammon/teachgammon/data.c bsd-games-2.17-p/backgammon/teachgammon/data.c
--- bsd-games-2.17/backgammon/teachgammon/data.c 2004-01-02 21:04:51.000000000 +0300
+++ bsd-games-2.17-p/backgammon/teachgammon/data.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/*#ifndef lint
#if 0
static char sccsid[] = "@(#)data.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: data.c,v 1.7 2004/01/01 15:59:09 jsm Exp $");
#endif
-#endif /* not lint */
+#endif *//* not lint */
#include "tutor.h"
diff -ur bsd-games-2.17/backgammon/teachgammon/teach.c bsd-games-2.17-p/backgammon/teachgammon/teach.c
--- bsd-games-2.17/backgammon/teachgammon/teach.c 2005-02-16 09:24:50.000000000 +0300
+++ bsd-games-2.17-p/backgammon/teachgammon/teach.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,18 +30,18 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/*#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n");
-#endif /* not lint */
+#endif *//* not lint */
-#ifndef lint
+/*#ifndef lint
#if 0
static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: teach.c,v 1.16 2005/02/15 12:56:20 jsm Exp $");
#endif
-#endif /* not lint */
+#endif *//* not lint */
#include "back.h"
#include "tutor.h"
@@ -59,6 +59,8 @@
0
};
+#define OXTABS XTABS
+
int
main(argc, argv)
int argc __attribute__((__unused__));
@@ -81,7 +83,7 @@
#ifdef V7
while (*++argv != 0)
#else
- while (*++argv != -1)
+ while (*++argv != 0)
#endif
getarg(&argv);
if (tflag) {
diff -ur bsd-games-2.17/backgammon/teachgammon/ttext1.c bsd-games-2.17-p/backgammon/teachgammon/ttext1.c
--- bsd-games-2.17/backgammon/teachgammon/ttext1.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/teachgammon/ttext1.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/*#ifndef lint
#if 0
static char sccsid[] = "@(#)ttext1.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: ttext1.c,v 1.7 2003/08/07 09:36:58 agc Exp $");
#endif
-#endif /* not lint */
+#endif *//* not lint */
#include "back.h"
#include "tutor.h"
diff -ur bsd-games-2.17/backgammon/teachgammon/ttext2.c bsd-games-2.17-p/backgammon/teachgammon/ttext2.c
--- bsd-games-2.17/backgammon/teachgammon/ttext2.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/teachgammon/ttext2.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/*#ifndef lint
#if 0
static char sccsid[] = "@(#)ttext2.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: ttext2.c,v 1.7 2003/08/07 09:36:58 agc Exp $");
#endif
-#endif /* not lint */
+#endif *//* not lint */
#include "back.h"
#include "tutor.h"
diff -ur bsd-games-2.17/backgammon/teachgammon/tutor.c bsd-games-2.17-p/backgammon/teachgammon/tutor.c
--- bsd-games-2.17/backgammon/teachgammon/tutor.c 2003-12-17 05:47:37.000000000 +0300
+++ bsd-games-2.17-p/backgammon/teachgammon/tutor.c 2011-02-15 11:22:28.988058843 +0300
@@ -30,13 +30,13 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
+/*#ifndef lint
#if 0
static char sccsid[] = "@(#)tutor.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: tutor.c,v 1.6 2003/08/07 09:36:58 agc Exp $");
#endif
-#endif /* not lint */
+#endif *//* not lint */
#include "back.h"
#include "tutor.h"