pkgsrc/games/battalion/patches/patch-ab

46 lines
1.2 KiB
Text

$NetBSD: patch-ab,v 1.4 1998/09/13 20:40:39 garbled Exp $
--- battalion.c.orig Thu Jan 16 09:31:59 1997
+++ battalion.c Sun Sep 13 12:51:53 1998
@@ -2874,11 +2874,16 @@
if (dataPath[strlen(dataPath)-1] != '/')
strcat(dataPath, "/");
-
- strcpy(fullPath, dataPath);
- strcat(fullPath, "battalion.sho");
- roadFile = fopen(fullPath, "rb");
}
+ else {
+ strcat(dataPath, DATADIR);
+ if (dataPath[strlen(dataPath)-1] != '/')
+ strcat(dataPath, "/");
+ }
+ strcpy(fullPath, dataPath);
+ strcat(fullPath, "battalion.sho");
+ roadFile = fopen(fullPath, "rb");
+
#endif
if (roadFile != NULL)
@@ -2898,10 +2903,10 @@
else
*/
{
- roadFile = fopen("./battalion.data/battalion.sho", "rb");
+ roadFile = fopen(DATADIR "battalion.data/battalion.sho", "rb");
if (roadFile != NULL)
{
- strcpy(dataPath, "./battalion.data/");
+ strcpy(dataPath, DATADIR "battalion.data/");
fclose(roadFile);
}
else
@@ -2990,7 +2995,7 @@
if (dataPtr != NULL)
strcpy(scoredataPath, dataPtr);
else
- strcpy(scoredataPath, "/usr/tmp");
+ strcpy(scoredataPath, VARDIR);
if (scoredataPath[strlen(scoredataPath)-1] != '/')
strcat(scoredataPath, "/");