updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / teeworlds-isrv / fix_datadir_search.patch
blob082bca83f7e60d2c1a35dba83b97b2544887dd80
1 diff -r 9582fcee983b -r c1502459a920 src/engine/e_engine.c
2 --- a/src/engine/e_engine.c Sun Feb 01 20:50:22 2009 +0100
3 +++ b/src/engine/e_engine.c Sun Feb 01 21:37:17 2009 +0100
4 @@ -539,14 +539,15 @@
7 /* 2) use data-dir in PWD if present */
8 - if(fs_is_dir("data"))
9 + /* test subdir "/maps" to reject unrelated "data" dir in PWD */
10 + if(fs_is_dir("data/maps"))
12 strcpy(datadir, "data");
13 return 0;
16 /* 3) use compiled-in data-dir if present */
17 - if (fs_is_dir(DATA_DIR))
18 + if (fs_is_dir(DATA_DIR "/maps"))
20 strcpy(datadir, DATA_DIR);
21 return 0;
22 @@ -572,9 +573,11 @@
23 /* 5) check for all default locations */
25 const char *sdirs[] = {
26 - "/usr/share/teeworlds",
27 - "/usr/local/share/teeworlds"
28 - "/opt/teeworlds"
29 + "/usr/share/teeworlds-isrv/data",
30 + "/usr/share/games/teeworlds-isrv/data",
31 + "/usr/local/share/teeworlds-isrv/data",
32 + "/usr/local/share/games/teeworlds-isrv/data",
33 + "/opt/teeworlds-isrv/data"
35 const int sdirs_count = sizeof(sdirs) / sizeof(sdirs[0]);