summaryrefslogtreecommitdiff
blob: f5522eda2a050a3e334461a77fc476e2a3191db0 (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
@@ -263,6 +263,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
@@ -83,6 +83,9 @@
 	return true;
       if (directoryManager.searchPath(MAUDE_LIB, directory, fileName, R_OK, ext))
 	return true;
+      directory = DATADIR;
+      if (directoryManager.checkAccess(directory, fileName, R_OK, ext))
+	return true;
       if (!(executableDirectory.empty()) &&
 	  directoryManager.checkAccess(executableDirectory, fileName, R_OK, ext))
 	{
--- 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);