Dash:
[t2.git] / package / games / bsd-games / hotfix-glibc.patch
blobfb700c10b0138a50f678ad1e92d230cd4536a00e
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../bsd-games/glibc.patch
5 # Copyright (C) 2009 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- ./boggle/boggle/bog.c
18 +++ ./boggle/boggle/bog.c
19 @@ -336,7 +336,7 @@
22 while (1) {
23 - if (getline(buf) == NULL) {
24 + if (get_line(buf) == NULL) {
25 if (feof(stdin))
26 clearerr(stdin);
27 break;
28 --- ./boggle/boggle/extern.h
29 +++ ./boggle/boggle/extern.h
30 @@ -43,7 +43,7 @@
31 long dictseek(FILE *, long, int);
32 void findword(void);
33 void flushin(FILE *);
34 -char *getline(char *);
35 +char *get_line(char *);
36 void getword(char *);
37 int help(void);
38 int inputch(void);
39 --- ./boggle/boggle/mach.c
40 +++ ./boggle/boggle/mach.c
41 @@ -168,7 +168,7 @@
42 * - doesn't accept words longer than MAXWORDLEN or containing caps
44 char *
45 -getline(q)
46 +get_line(q)
47 char *q;
49 int ch, done;
50 --- ./cribbage/cribbage.h
51 +++ ./cribbage/cribbage.h
52 @@ -77,7 +77,7 @@
53 int fifteens(const CARD [], int);
54 void game(void);
55 void gamescore(void);
56 -char *getline(void);
57 +char *get_line(void);
58 int getuchar(void);
59 int incard(CARD *);
60 int infrom(const CARD [], int, const char *);
61 --- ./cribbage/crib.c
62 +++ ./cribbage/crib.c
63 @@ -221,7 +221,7 @@
64 if (!rflag) { /* player cuts deck */
65 msg(quiet ? "Cut for crib? " :
66 "Cut to see whose crib it is -- low card wins? ");
67 - getline();
68 + get_line();
70 i = (rand() >> 4) % CARDS; /* random cut */
71 do { /* comp cuts deck */
72 @@ -397,7 +397,7 @@
73 if (!rflag) { /* random cut */
74 msg(quiet ? "Cut the deck? " :
75 "How many cards down do you wish to cut the deck? ");
76 - getline();
77 + get_line();
79 i = (rand() >> 4) % (CARDS - pos);
80 turnover = deck[i + pos];
81 --- ./cribbage/io.c
82 +++ ./cribbage/io.c
83 @@ -245,7 +245,7 @@
85 retval = FALSE;
86 rnk = sut = EMPTY;
87 - if (!(line = getline()))
88 + if (!(line = get_line()))
89 goto gotit;
90 p = p1 = line;
91 while (*p1 != ' ' && *p1 != '\0')
92 @@ -346,7 +346,7 @@
94 for (sum = 0;;) {
95 msg(prompt);
96 - if (!(p = getline()) || *p == '\0') {
97 + if (!(p = get_line()) || *p == '\0') {
98 msg(quiet ? "Not a number" :
99 "That doesn't look like a number");
100 continue;
101 @@ -528,12 +528,12 @@
105 - * getline:
106 + * get_line:
107 * Reads the next line up to '\n' or EOF. Multiple spaces are
108 * compressed to one space; a space is inserted before a ','
110 char *
111 -getline()
112 +get_line()
114 char *sp;
115 int c, oy, ox;
116 --- ./gomoku/bdisp.c
117 +++ ./gomoku/bdisp.c
118 @@ -241,7 +241,7 @@
122 -getline(buf, size)
123 +get_line(buf, size)
124 char *buf;
125 int size;
127 --- ./gomoku/gomoku.h
128 +++ ./gomoku/gomoku.h
129 @@ -263,7 +263,7 @@
131 void bdinit(struct spotstr *);
132 void init_overlap(void);
133 -int getline(char *, int);
134 +int get_line(char *, int);
135 void ask(const char *);
136 void dislog(const char *);
137 void bdump(FILE *);
138 --- ./gomoku/main.c
139 +++ ./gomoku/main.c
140 @@ -155,7 +155,7 @@
141 if (inputfp == NULL && test == 0) {
142 for (;;) {
143 ask("black or white? ");
144 - getline(buf, sizeof(buf));
145 + get_line(buf, sizeof(buf));
146 if (buf[0] == 'b' || buf[0] == 'B') {
147 color = BLACK;
148 break;
149 @@ -172,7 +172,7 @@
151 } else {
152 setbuf(stdout, 0);
153 - getline(buf, sizeof(buf));
154 + get_line(buf, sizeof(buf));
155 if (strcmp(buf, "black") == 0)
156 color = BLACK;
157 else if (strcmp(buf, "white") == 0)
158 @@ -244,7 +244,7 @@
159 getinput:
160 if (interactive)
161 ask("move? ");
162 - if (!getline(buf, sizeof(buf))) {
163 + if (!get_line(buf, sizeof(buf))) {
164 curmove = RESIGN;
165 break;
167 @@ -256,7 +256,7 @@
168 FILE *fp;
170 ask("save file name? ");
171 - (void)getline(buf, sizeof(buf));
172 + (void)get_line(buf, sizeof(buf));
173 if ((fp = fopen(buf, "w")) == NULL) {
174 glog("cannot create save file");
175 goto getinput;
176 @@ -309,14 +309,14 @@
177 if (i != RESIGN) {
178 replay:
179 ask("replay? ");
180 - if (getline(buf, sizeof(buf)) &&
181 + if (get_line(buf, sizeof(buf)) &&
182 (buf[0] == 'y' || buf[0] == 'Y'))
183 goto again;
184 if (strcmp(buf, "save") == 0) {
185 FILE *fp;
187 ask("save file name? ");
188 - (void)getline(buf, sizeof(buf));
189 + (void)get_line(buf, sizeof(buf));
190 if ((fp = fopen(buf, "w")) == NULL) {
191 glog("cannot create save file");
192 goto replay;
193 @@ -367,7 +367,7 @@
194 quit();
195 top:
196 ask("cmd? ");
197 - if (!getline(fmtbuf, sizeof(fmtbuf)))
198 + if (!get_line(fmtbuf, sizeof(fmtbuf)))
199 quit();
200 switch (*fmtbuf) {
201 case '\0':