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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
Index: gemrb/plugins/Core/Interface.cpp
===================================================================
--- gemrb/plugins/Core/Interface.cpp (revision 5876)
+++ gemrb/plugins/Core/Interface.cpp (working copy)
@@ -1813,59 +1813,51 @@
//if (!name[0]) // FIXME: could this happen?
// strcpy (name, PACKAGE); // ugly hack
- // If we were called as $0 -c <filename>, load config from filename
- if (argc > 2 && ! strcmp("-c", argv[1])) {
- if (LoadConfig( argv[2] )) {
- return true;
- } else {
- // Explicitly specified cfg file HAS to be present
- return false;
- }
- }
-
// FIXME: temporary hack, to be deleted??
if (LoadConfig( "GemRB.cfg" )) {
return true;
}
- PathJoin( path, UserDir, name, NULL );
- strcat( path, ".cfg" );
-
- if (LoadConfig( path )) {
- return true;
- }
-
+ // Read gemrb.cfg
#ifdef SYSCONFDIR
- PathJoin( path, SYSCONFDIR, name, NULL );
+ PathJoin( path, SYSCONFDIR, PACKAGE, NULL );
strcat( path, ".cfg" );
- if (LoadConfig( path )) {
- return true;
- }
+ LoadConfig( path );
#endif
- // Don't try with default binary name if we have tried it already
- if (!strcmp( name, PACKAGE )) {
- return false;
- }
-
PathJoin( path, UserDir, PACKAGE, NULL );
strcat( path, ".cfg" );
- if (LoadConfig( path )) {
- return true;
- }
+ LoadConfig( path );
+ // Read binary name config
+ // Don't try with default binary name if we have tried it already
+ if (strcmp( name, PACKAGE )) {
#ifdef SYSCONFDIR
- PathJoin( path, SYSCONFDIR, PACKAGE, NULL );
- strcat( path, ".cfg" );
+ PathJoin( path, SYSCONFDIR, name, NULL );
+ strcat( path, ".cfg" );
- if (LoadConfig( path )) {
- return true;
- }
+ LoadConfig( path );
#endif
- return false;
+ PathJoin( path, UserDir, name, NULL );
+ strcat( path, ".cfg" );
+ LoadConfig( path );
+ }
+
+ // If we were called as $0 -c <filename>, load config from filename
+ if (argc > 2 && ! strcmp("-c", argv[1])) {
+ if (LoadConfig( argv[2] )) {
+ return true;
+ } else {
+ // Explicitly specified cfg file HAS to be present
+ return false;
+ }
+ }
+
+ return true;
+
#else // WIN32
// If we were called as $0 -c <filename>, load config from filename
if (argc > 2 && ! strcmp("-c", argv[1])) {
|