|
48 | 48 |
|
49 | 49 | /* }================================================================== */ |
50 | 50 |
|
51 | | -@@ -231,7 +236,10 @@ |
| 51 | +@@ -221,17 +226,43 @@ |
| 52 | + LUA_CDIR"loadall.dll;" ".\\?.dll" |
| 53 | + #endif |
| 54 | + |
| 55 | ++#elif defined(_DOS) || defined(__OS2__) |
| 56 | ++/* |
| 57 | ++** DOS and OS/2 do not have any mechanism to get the running process path. |
| 58 | ++** Default to the current directory instead. |
| 59 | ++*/ |
| 60 | ++ |
| 61 | ++#if !defined(LUA_PATH_DEFAULT) |
| 62 | ++#define LUA_PATH_DEFAULT ".\\?.lua;" ".\\?\\init.lua" |
| 63 | ++#endif |
| 64 | ++ |
| 65 | ++#if !defined(LUA_CPATH_DEFAULT) |
| 66 | ++#define LUA_CPATH_DEFAULT ".\\?.dll" |
| 67 | ++#endif |
| 68 | ++ |
| 69 | + #else /* }{ */ |
| 70 | + |
| 71 | ++/* |
| 72 | ++** For Linux and (hopefully) compatible with other Unix-like systems |
| 73 | ++*/ |
| 74 | ++ |
| 75 | + #define LUA_ROOT "/usr/local/" |
| 76 | + #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" |
| 77 | + #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" |
| 78 | + |
| 79 | + #if !defined(LUA_PATH_DEFAULT) |
| 80 | ++/* |
| 81 | ++ * Linux is notorious for case-sensitive filenames. |
| 82 | ++ * Check for .LUA in addition to .lua |
| 83 | ++ * in case scripts are on a mount that uppercased the all filenames. |
| 84 | ++ */ |
52 | 85 | #define LUA_PATH_DEFAULT \ |
53 | 86 | LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ |
54 | 87 | LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ |
55 | 88 | - "./?.lua;" "./?/init.lua" |
56 | 89 | + "./?.lua;" "./?/init.lua" \ |
57 | | -+ LUA_LDIR"?.LUA;" LUA_LDIR"?/init.LUA;" \ |
58 | | -+ LUA_CDIR"?.LUA;" LUA_CDIR"?/init.LUA;" \ |
59 | | -+ "./?.LUA;" "./?/init.LUA" |
| 90 | ++ LUA_LDIR"?.LUA;" LUA_LDIR"?/INIT.LUA;" \ |
| 91 | ++ LUA_CDIR"?.LUA;" LUA_CDIR"?/INIT.LUA;" \ |
| 92 | ++ "./?.LUA;" "./?/INIT.LUA" |
60 | 93 | #endif |
61 | 94 |
|
62 | 95 | #if !defined(LUA_CPATH_DEFAULT) |
| 96 | +@@ -249,7 +280,7 @@ |
| 97 | + */ |
| 98 | + #if !defined(LUA_DIRSEP) |
| 99 | + |
| 100 | +-#if defined(_WIN32) |
| 101 | ++#if defined(_WIN32) || defined(_DOS) || defined(__OS2__) |
| 102 | + #define LUA_DIRSEP "\\" |
| 103 | + #else |
| 104 | + #define LUA_DIRSEP "/" |
63 | 105 | --- lua/lutf8lib.c |
64 | 106 | +++ lua/lutf8lib.c |
65 | 107 | @@ -31,7 +31,9 @@ |
|
0 commit comments