summaryrefslogtreecommitdiff
path: root/games/battalion/patches/patch-ab
blob: 725157dd16885bbb72dff63c6c7c139602e383f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$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, "/");