head 1.5; access; symbols pkgsrc-2026Q1:1.2.0.10 pkgsrc-2026Q1-base:1.2 pkgsrc-2025Q4:1.2.0.8 pkgsrc-2025Q4-base:1.2 pkgsrc-2025Q3:1.2.0.6 pkgsrc-2025Q3-base:1.2 pkgsrc-2025Q2:1.2.0.4 pkgsrc-2025Q2-base:1.2 pkgsrc-2025Q1:1.2.0.2 pkgsrc-2025Q1-base:1.2 pkgsrc-2024Q4:1.1.0.72 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.70 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.68 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.66 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.64 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.62 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.60 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.58 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.56 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.54 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.52 pkgsrc-2022Q2-base:1.1 pkgsrc-2022Q1:1.1.0.50 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.48 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.46 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.44 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.42 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.40 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.38 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.34 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.14 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.36 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.32 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.30 pkgsrc-2019Q2-base:1.1 pkgsrc-2019Q1:1.1.0.28 pkgsrc-2019Q1-base:1.1 pkgsrc-2018Q4:1.1.0.26 pkgsrc-2018Q4-base:1.1 pkgsrc-2018Q3:1.1.0.24 pkgsrc-2018Q3-base:1.1 pkgsrc-2018Q2:1.1.0.22 pkgsrc-2018Q2-base:1.1 pkgsrc-2018Q1:1.1.0.20 pkgsrc-2018Q1-base:1.1 pkgsrc-2017Q4:1.1.0.18 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.16 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.12 pkgsrc-2017Q2-base:1.1 pkgsrc-2017Q1:1.1.0.10 pkgsrc-2017Q1-base:1.1 pkgsrc-2016Q4:1.1.0.8 pkgsrc-2016Q4-base:1.1 pkgsrc-2016Q3:1.1.0.6 pkgsrc-2016Q3-base:1.1 pkgsrc-2016Q2:1.1.0.4 pkgsrc-2016Q2-base:1.1 pkgsrc-2016Q1:1.1.0.2 pkgsrc-2016Q1-base:1.1; locks; strict; comment @ * @; 1.5 date 2026.04.21.05.12.14; author wiz; state dead; branches; next 1.4; commitid KIiZyjBBT212JMCG; 1.4 date 2026.04.16.12.34.46; author wiz; state Exp; branches; next 1.3; commitid 49PbGLoHqlsSkbCG; 1.3 date 2026.04.16.12.29.43; author wiz; state Exp; branches; next 1.2; commitid Y3Tn0fV6iqi7jbCG; 1.2 date 2025.02.08.10.49.45; author triaxx; state Exp; branches; next 1.1; commitid UfbbefTt9e9ODEIF; 1.1 date 2016.01.11.19.37.43; author leot; state Exp; branches; next ; commitid ihB69dfIJkwT8yQy; desc @@ 1.5 log @vms-empire: update to 1.21. Yet more code hardening. Documentation fully cobveted to asciidoc. @ text @$NetBSD: patch-usermove.c,v 1.4 2026/04/16 12:34:46 wiz Exp $ Fix ctype(3) functions usage. https://gitlab.com/esr/vms-empire/-/work_items/6 --- usermove.c.orig 2026-04-16 12:16:09.000000000 +0000 +++ usermove.c @@@@ -997,7 +997,7 @@@@ void user_dir_army(piece_info_t *obj, loc_t loc) { ksend("Your army marched dutifully into the sea and " "drowned.\n"); } else { /* attack something at sea */ - enemy_killed = islower(game.user_map[loc].contents); + enemy_killed = islower((unsigned char)game.user_map[loc].contents); attack(obj, loc); if (obj->hits > 0) /* ship won? */ @@@@ -1016,7 +1016,7 @@@@ void user_dir_army(piece_info_t *obj, loc_t loc) { } } - else if (isupper(game.user_map[loc].contents) && + else if (isupper((unsigned char)game.user_map[loc].contents) && game.user_map[loc].contents != 'X') { /* attacking self */ if (!getyn("Sir, those are our men! Do you really want to " "attack them? ")) { @@@@ -1044,7 +1044,7 @@@@ void user_dir_fighter(piece_info_t *obj, loc_t loc) { "Your fighter was shot down."); } - else if (isupper(game.user_map[loc].contents)) { + else if (isupper((unsigned char)game.user_map[loc].contents)) { if (!getyn("Sir, those are our men! " "Do you really want to attack them? ")) { return; @@@@ -1092,7 +1092,7 @@@@ void user_dir_ship(piece_info_t *obj, loc_t loc) { ksend("Your %s broke up on shore.", piece_attr[obj->type].name); } else { /* attack something on shore */ - enemy_killed = islower(game.user_map[loc].contents); + enemy_killed = islower((unsigned char)game.user_map[loc].contents); attack(obj, loc); if (obj->hits > 0) /* ship won? */ @@@@ -1113,7 +1113,7 @@@@ void user_dir_ship(piece_info_t *obj, loc_t loc) { } } - else if (isupper(game.user_map[loc].contents)) { /* attacking self */ + else if (isupper((unsigned char)game.user_map[loc].contents)) { /* attacking self */ if (!getyn("Sir, those are our men! Do you really want to " "attack them? ")) { return; @@@@ -1201,7 +1201,7 @@@@ bool awake(piece_info_t *obj) { char c = game.user_map[loc].contents; const piece_info_t *enemy = find_obj_at_loc(loc); - if ((islower(c) && (enemy == NULL || enemy->type != SATELLITE)) || + if ((islower((unsigned char)c) && (enemy == NULL || enemy->type != SATELLITE)) || c == MAP_CITY || c == 'X') { if (obj->func < 0) { obj->func = NOFUNC; /* awaken */ @ 1.4 log @vms-empire: add upstream bug report URL @ text @d1 1 a1 1 $NetBSD: patch-usermove.c,v 1.3 2026/04/16 12:29:43 wiz Exp $ @ 1.3 log @vms-empire: update to 1.20. 1.20: 2026-04-16:: More code hardening. Fix for ancient bug: enemy satellites no longer awaken your pieces. @ text @d1 1 a1 1 $NetBSD: patch-usermove.c,v 1.2 2025/02/08 10:49:45 triaxx Exp $ d4 1 @ 1.2 log @vms-empire: Update to 1.18 upstream changes: ----------------- 1.18: 2024-10-03:: Port changes for GCC 10. 1.17: 2024-02-11:: Remove unnecessary delays. Fix a defective sort in the fame AI. 1.16: 2021-02-25 20:52:1Z Minor documentation fixes and code cleanup. @ text @d1 1 a1 1 $NetBSD: patch-usermove.c,v 1.1 2016/01/11 19:37:43 leot Exp $ d5 1 a5 1 --- usermove.c.orig 2024-02-11 16:53:28.000000000 +0000 d7 1 a7 1 @@@@ -997,7 +997,7 @@@@ void user_dir_army(piece_info_t *obj, lo d16 1 a16 1 @@@@ -1016,7 +1016,7 @@@@ void user_dir_army(piece_info_t *obj, lo d25 1 a25 1 @@@@ -1044,7 +1044,7 @@@@ void user_dir_fighter(piece_info_t *obj, d34 1 a34 1 @@@@ -1089,7 +1089,7 @@@@ void user_dir_ship(piece_info_t *obj, lo d43 1 a43 1 @@@@ -1110,7 +1110,7 @@@@ void user_dir_ship(piece_info_t *obj, lo d52 7 a58 6 @@@@ -1196,7 +1196,7 @@@@ bool awake(piece_info_t *obj) { for (i = 0; i < 8; i++) { /* for each surrounding cell */ char c = game.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') { a60 1 } @ 1.1 log @Update games/vms-empire to 1.14. 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. @ text @d1 1 a1 1 $NetBSD$ d5 1 a5 1 --- usermove.c.orig 2014-12-15 16:26:35.000000000 +0000 d7 11 a17 2 @@@@ -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"); d19 8 a26 7 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 d28 17 a44 18 } - 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); a45 4 else { /* attack something on shore */ - enemy_killed = islower (user_map[loc].contents); + enemy_killed = islower ((unsigned char)user_map[loc].contents); attack (obj, loc); d47 14 a60 19 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); } @