guix/gnu/packages/patches/bsd-games-getline.patch
Vitaliy Shatrov 95024494f3
gnu: Add bsd-games.
* gnu/packages/games.scm (bsd-games): New variable.

New patches, taken from Arch and Debian:
* gnu/packages/patches/bsd-games-2.17-64bit.patch
* gnu/packages/patches/bsd-games-bad-ntohl-cast.patch
* gnu/packages/patches/bsd-games-gamescreen.h.patch
* gnu/packages/patches/bsd-games-getline.patch
* gnu/packages/patches/bsd-games-null-check.patch
* gnu/packages/patches/bsd-games-number.c-and-test.patch
* gnu/packages/patches/bsd-games-prevent-name-collisions.patch
* gnu/packages/patches/bsd-games-stdio.h.patch

New patches with our customizations (configure-config built after Arch's):
* gnu/packages/patches/bsd-games-add-configure-config.patch
* gnu/packages/patches/bsd-games-add-wrapper.patch
* gnu/packages/patches/bsd-games-dont-install-empty-files.patch

Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
2020-11-04 15:15:47 +01:00

194 lines
5.8 KiB
Diff

diff -Naur bsd-games-2.17/boggle/boggle/bog.c bsd-games-2.17.1/boggle/boggle/bog.c
--- bsd-games-2.17/boggle/boggle/bog.c 2004-12-07 07:34:21.000000000 -0600
+++ bsd-games-2.17.1/boggle/boggle/bog.c 2010-05-22 10:51:23.000000000 -0500
@@ -336,7 +336,7 @@
}
while (1) {
- if (getline(buf) == NULL) {
+ if (boggle_getline(buf) == NULL) {
if (feof(stdin))
clearerr(stdin);
break;
diff -Naur bsd-games-2.17/boggle/boggle/extern.h bsd-games-2.17.1/boggle/boggle/extern.h
--- bsd-games-2.17/boggle/boggle/extern.h 2004-01-27 14:52:07.000000000 -0600
+++ bsd-games-2.17.1/boggle/boggle/extern.h 2010-05-22 10:51:23.000000000 -0500
@@ -43,7 +43,7 @@
long dictseek(FILE *, long, int);
void findword(void);
void flushin(FILE *);
-char *getline(char *);
+char *boggle_getline(char *);
void getword(char *);
int help(void);
int inputch(void);
diff -Naur bsd-games-2.17/boggle/boggle/mach.c bsd-games-2.17.1/boggle/boggle/mach.c
--- bsd-games-2.17/boggle/boggle/mach.c 2004-12-07 07:34:21.000000000 -0600
+++ bsd-games-2.17.1/boggle/boggle/mach.c 2010-05-22 10:51:23.000000000 -0500
@@ -168,7 +168,7 @@
* - doesn't accept words longer than MAXWORDLEN or containing caps
*/
char *
-getline(q)
+boggle_getline(q)
char *q;
{
int ch, done;
diff -Naur bsd-games-2.17/cribbage/cribbage.h bsd-games-2.17.1/cribbage/cribbage.h
--- bsd-games-2.17/cribbage/cribbage.h 2004-02-08 16:29:14.000000000 -0600
+++ bsd-games-2.17.1/cribbage/cribbage.h 2010-05-22 10:51:23.000000000 -0500
@@ -77,7 +77,7 @@
int fifteens(const CARD [], int);
void game(void);
void gamescore(void);
-char *getline(void);
+char *cribbage_getline(void);
int getuchar(void);
int incard(CARD *);
int infrom(const CARD [], int, const char *);
diff -Naur bsd-games-2.17/cribbage/crib.c bsd-games-2.17.1/cribbage/crib.c
--- bsd-games-2.17/cribbage/crib.c 2004-01-27 14:52:07.000000000 -0600
+++ bsd-games-2.17.1/cribbage/crib.c 2010-05-22 10:51:23.000000000 -0500
@@ -221,7 +221,7 @@
if (!rflag) { /* player cuts deck */
msg(quiet ? "Cut for crib? " :
"Cut to see whose crib it is -- low card wins? ");
- getline();
+ cribbage_getline();
}
i = (rand() >> 4) % CARDS; /* random cut */
do { /* comp cuts deck */
@@ -397,7 +397,7 @@
if (!rflag) { /* random cut */
msg(quiet ? "Cut the deck? " :
"How many cards down do you wish to cut the deck? ");
- getline();
+ cribbage_getline();
}
i = (rand() >> 4) % (CARDS - pos);
turnover = deck[i + pos];
diff -Naur bsd-games-2.17/cribbage/io.c bsd-games-2.17.1/cribbage/io.c
--- bsd-games-2.17/cribbage/io.c 2004-12-07 07:34:21.000000000 -0600
+++ bsd-games-2.17.1/cribbage/io.c 2010-05-22 10:51:23.000000000 -0500
@@ -245,7 +245,7 @@
retval = FALSE;
rnk = sut = EMPTY;
- if (!(line = getline()))
+ if (!(line = cribbage_getline()))
goto gotit;
p = p1 = line;
while (*p1 != ' ' && *p1 != '\0')
@@ -346,7 +346,7 @@
for (sum = 0;;) {
msg(prompt);
- if (!(p = getline()) || *p == '\0') {
+ if (!(p = cribbage_getline()) || *p == '\0') {
msg(quiet ? "Not a number" :
"That doesn't look like a number");
continue;
@@ -528,12 +528,12 @@
}
/*
- * getline:
+ * cribbage_getline:
* Reads the next line up to '\n' or EOF. Multiple spaces are
* compressed to one space; a space is inserted before a ','
*/
char *
-getline()
+cribbage_getline()
{
char *sp;
int c, oy, ox;
diff -Naur bsd-games-2.17/gomoku/bdisp.c bsd-games-2.17.1/gomoku/bdisp.c
--- bsd-games-2.17/gomoku/bdisp.c 2003-12-16 20:47:37.000000000 -0600
+++ bsd-games-2.17.1/gomoku/bdisp.c 2010-05-22 10:51:23.000000000 -0500
@@ -241,7 +241,7 @@
}
int
-getline(buf, size)
+gomoku_getline(buf, size)
char *buf;
int size;
{
diff -Naur bsd-games-2.17/gomoku/gomoku.h bsd-games-2.17.1/gomoku/gomoku.h
--- bsd-games-2.17/gomoku/gomoku.h 2004-01-27 14:52:07.000000000 -0600
+++ bsd-games-2.17.1/gomoku/gomoku.h 2010-05-22 10:51:23.000000000 -0500
@@ -263,7 +263,7 @@
void bdinit(struct spotstr *);
void init_overlap(void);
-int getline(char *, int);
+int gomoku_getline(char *, int);
void ask(const char *);
void dislog(const char *);
void bdump(FILE *);
diff -Naur bsd-games-2.17/gomoku/main.c bsd-games-2.17.1/gomoku/main.c
--- bsd-games-2.17/gomoku/main.c 2004-01-27 14:52:07.000000000 -0600
+++ bsd-games-2.17.1/gomoku/main.c 2010-05-22 10:51:23.000000000 -0500
@@ -155,7 +155,7 @@
if (inputfp == NULL && test == 0) {
for (;;) {
ask("black or white? ");
- getline(buf, sizeof(buf));
+ gomoku_getline(buf, sizeof(buf));
if (buf[0] == 'b' || buf[0] == 'B') {
color = BLACK;
break;
@@ -172,7 +172,7 @@
}
} else {
setbuf(stdout, 0);
- getline(buf, sizeof(buf));
+ gomoku_getline(buf, sizeof(buf));
if (strcmp(buf, "black") == 0)
color = BLACK;
else if (strcmp(buf, "white") == 0)
@@ -244,7 +244,7 @@
getinput:
if (interactive)
ask("move? ");
- if (!getline(buf, sizeof(buf))) {
+ if (!gomoku_getline(buf, sizeof(buf))) {
curmove = RESIGN;
break;
}
@@ -256,7 +256,7 @@
FILE *fp;
ask("save file name? ");
- (void)getline(buf, sizeof(buf));
+ (void)gomoku_getline(buf, sizeof(buf));
if ((fp = fopen(buf, "w")) == NULL) {
glog("cannot create save file");
goto getinput;
@@ -309,14 +309,14 @@
if (i != RESIGN) {
replay:
ask("replay? ");
- if (getline(buf, sizeof(buf)) &&
+ if (gomoku_getline(buf, sizeof(buf)) &&
(buf[0] == 'y' || buf[0] == 'Y'))
goto again;
if (strcmp(buf, "save") == 0) {
FILE *fp;
ask("save file name? ");
- (void)getline(buf, sizeof(buf));
+ (void)gomoku_getline(buf, sizeof(buf));
if ((fp = fopen(buf, "w")) == NULL) {
glog("cannot create save file");
goto replay;
@@ -367,7 +367,7 @@
quit();
top:
ask("cmd? ");
- if (!getline(fmtbuf, sizeof(fmtbuf)))
+ if (!gomoku_getline(fmtbuf, sizeof(fmtbuf)))
quit();
switch (*fmtbuf) {
case '\0':