summaryrefslogtreecommitdiff
path: root/dev-lang/maude/files/maude-3.4-search-datadir.patch
blob: c6ca86de6bc6f5bb7ced4aea559fa759b2eefaed (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
Have maude search in datadir for its files.
--- a/src/Main/main.cc
+++ b/src/Main/main.cc
@@ -350,6 +350,11 @@
 {
   if (directoryManager.searchPath(MAUDE_LIB, directory, fileName, R_OK))
     return true;
+  if (directoryManager.checkAccess(DATADIR, fileName, R_OK))
+    {
+      directory = DATADIR;
+      return true;
+    }
   if (!(executableDirectory.empty()) &&
       directoryManager.checkAccess(executableDirectory, fileName, R_OK))
     {
--- a/src/Mixfix/global.cc
+++ b/src/Mixfix/global.cc
@@ -116,6 +116,9 @@
       //
       if (directoryManager.searchPath(MAUDE_LIB, directory, fileName, R_OK, ext))
 	return true;
+      directory = DATADIR;
+      if (directoryManager.checkAccess(directory, fileName, R_OK, ext))
+	return true;
       //
       //	Last hope is the directory containing the Maude executable.
       //
--- a/src/Mixfix/global.hh
+++ b/src/Mixfix/global.hh
@@ -36,6 +36,7 @@
 
 #define PRELUDE_NAME	"prelude.maude"
 #define MAUDE_LIB	"MAUDE_LIB"
+#define DATADIR         "/usr/share/maude"
 
 bool
 findPrelude(string& directory, string& fileName);