930757fb15
Patch based on PR pkg/50624 provided by Ben Gergely. Thanks to riastradh@, joerg@ and dholland@ for misc suggestions and review. pkgsrc changes: o Add LICENSE o Instead of define a do-install use the install target provided by upstream Changes: 1.14: 2016-01-05 06:49:17Z Add an identifying magic cookie and version to save files. Full ANSI prototypes for private functions as well as public. Markup fix for probability table. 1.13: 2014-12-14T17:06:26Z Comment on entry to and exit from edit mode. Cleaned up packaging and install/uninstall productions. 1.12: 2014-05-20T09:03:09Z Incorporated Dennis Pinckard's fix for a Mac OS/X port bug. Added desktop file. 1.11: 2013-12-31T17:31:04Z Clean up code to modern C, apply cppcheck. Fix code typo reported as Debian bug #593434 1.10: 2013-08-22T23:47:21Z Fix core dump when a satellite bounced off the world edge. Full ANSIfication of function prototypes (which fixed the sat bug - the code appears to have been tickling some obscure bug in the compilation of function calls with K&R-style prototypes). 1.9: 2012-02-16T22:59:22Z Drop RPM packaging. Documentation cleanups. 1.8: 2010-10-21T12:47:33Z Joe Wells's patch to enable different-sized worlds. Minor fixes to map functions by Andrew Morrow. More on the history of the game. Enable arrow keys in edit mode. License changed from Chuck Simmons's cosmetically tweaked clone of the GPL to GPL proper, so the classifier systems that forge and archive sites use will be less confused.
60 lines
2.3 KiB
C
60 lines
2.3 KiB
C
$NetBSD: patch-usermove.c,v 1.1 2016/01/11 19:37:43 leot Exp $
|
|
|
|
Fix ctype(3) functions usage.
|
|
|
|
--- usermove.c.orig 2014-12-15 16:26:35.000000000 +0000
|
|
+++ usermove.c
|
|
@@ -878,7 +878,7 @@ user_dir_army(piece_info_t *obj, loc_t l
|
|
ksend ("Your army marched dutifully into the sea and drowned.\n");
|
|
}
|
|
else { /* attack something at sea */
|
|
- enemy_killed = islower (user_map[loc].contents);
|
|
+ enemy_killed = islower ((unsigned char)user_map[loc].contents);
|
|
attack (obj, loc);
|
|
|
|
if (obj->hits > 0) /* ship won? */
|
|
@@ -894,7 +894,7 @@ user_dir_army(piece_info_t *obj, loc_t l
|
|
}
|
|
}
|
|
|
|
- else if (isupper (user_map[loc].contents)
|
|
+ else if (isupper ((unsigned char)user_map[loc].contents)
|
|
&& user_map[loc].contents != 'X') { /* attacking self */
|
|
if (!getyn (
|
|
"Sir, those are our men! Do you really want to attack them? "))
|
|
@@ -919,7 +919,7 @@ user_dir_fighter(piece_info_t *obj, loc_
|
|
"That's never worked before, sir. Do you really want to try? ",
|
|
"Your fighter was shot down.");
|
|
|
|
- else if (isupper (user_map[loc].contents)) {
|
|
+ else if (isupper ((unsigned char)user_map[loc].contents)) {
|
|
if (!getyn ("Sir, those are our men! "
|
|
"Do you really want to attack them? "))
|
|
return;
|
|
@@ -959,7 +959,7 @@ user_dir_ship(piece_info_t *obj, loc_t l
|
|
ksend ("Your %s broke up on shore.", piece_attr[obj->type].name);
|
|
}
|
|
else { /* attack something on shore */
|
|
- enemy_killed = islower (user_map[loc].contents);
|
|
+ enemy_killed = islower ((unsigned char)user_map[loc].contents);
|
|
attack (obj, loc);
|
|
|
|
if (obj->hits > 0) /* ship won? */
|
|
@@ -975,7 +975,7 @@ user_dir_ship(piece_info_t *obj, loc_t l
|
|
}
|
|
}
|
|
|
|
- else if (isupper (user_map[loc].contents)) { /* attacking self */
|
|
+ else if (isupper ((unsigned char)user_map[loc].contents)) { /* attacking self */
|
|
if (!getyn (
|
|
"Sir, those are our men! Do you really want to attack them? "))
|
|
return;
|
|
@@ -1062,7 +1062,7 @@ awake(piece_info_t *obj)
|
|
for (i = 0; i < 8; i++) { /* for each surrounding cell */
|
|
char c = user_map[obj->loc+dir_offset[i]].contents;
|
|
|
|
- if (islower (c) || c == MAP_CITY || c == 'X') {
|
|
+ if (islower ((unsigned char)c) || c == MAP_CITY || c == 'X') {
|
|
if (obj->func < 0) obj->func = NOFUNC; /* awaken */
|
|
return (true);
|
|
}
|