2000-05-18 05:25:38 +00:00
|
|
|
--- file.c Mon Apr 24 23:19:46 2000
|
|
|
|
+++ file.c.new Mon Apr 24 23:25:07 2000
|
|
|
|
@@ -1,14 +1,18 @@
|
2000-02-17 01:04:30 +00:00
|
|
|
#include "gltron.h"
|
2000-05-18 05:25:38 +00:00
|
|
|
|
2000-02-17 01:04:30 +00:00
|
|
|
+#ifndef SHARE1
|
|
|
|
+#define SHARE1 "\"/usr/local/share/gltron\""
|
|
|
|
+#endif
|
|
|
|
+#ifndef SHARE2
|
|
|
|
+#define SHARE2 "\"/usr/X11R6/share/gltron\""
|
|
|
|
+#endif
|
2000-05-18 05:25:38 +00:00
|
|
|
+
|
|
|
|
static char* subdir = "data";
|
2000-02-17 01:04:30 +00:00
|
|
|
char* getFullPath(char *filename) {
|
|
|
|
char *path;
|
|
|
|
FILE *fp = NULL;
|
|
|
|
char *base;
|
|
|
|
|
|
|
|
- char *share1 = "/usr/share/games/gltron";
|
|
|
|
- char *share2 = "/usr/local/share/games/gltron";
|
|
|
|
-
|
|
|
|
/* check a few directories for the files and */
|
|
|
|
/* return the full path. */
|
|
|
|
|
2000-05-18 05:25:38 +00:00
|
|
|
@@ -44,8 +48,8 @@
|
2000-02-17 01:04:30 +00:00
|
|
|
printf("unsuccessful\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
- path = malloc(strlen(share1) + 1 + strlen(filename) + 1);
|
|
|
|
- sprintf(path, "%s%c%s", share1, SEPERATOR, filename);
|
|
|
|
+ path = malloc(strlen(SHARE1) + 1 + strlen(filename) + 1);
|
|
|
|
+ sprintf(path, "%s%c%s", SHARE1, SEPERATOR, filename);
|
|
|
|
|
|
|
|
printf("checking '%s'", path);
|
|
|
|
fp = fopen(path, "r");
|
2000-05-18 05:25:38 +00:00
|
|
|
@@ -57,8 +61,8 @@
|
2000-02-17 01:04:30 +00:00
|
|
|
free(path);
|
|
|
|
printf("unsuccessful\n");
|
|
|
|
|
|
|
|
- path = malloc(strlen(share2) + 1 + strlen(filename) + 1);
|
|
|
|
- sprintf(path, "%s%c%s", share2, SEPERATOR, filename);
|
|
|
|
+ path = malloc(strlen(SHARE2) + 1 + strlen(filename) + 1);
|
|
|
|
+ sprintf(path, "%s%c%s", SHARE2, SEPERATOR, filename);
|
|
|
|
|
|
|
|
printf("checking '%s'", path);
|
|
|
|
fp = fopen(path, "r");
|