Skip to content

Commit 7e0da7d

Browse files
committed
Updated lua.pat so that DOS and OS/2 interpreters don't get the Linux default package path.
1 parent 2b1b378 commit 7e0da7d

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

lua.pat

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,60 @@
4848

4949
/* }================================================================== */
5050

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+
+ */
5285
#define LUA_PATH_DEFAULT \
5386
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
5487
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
5588
- "./?.lua;" "./?/init.lua"
5689
+ "./?.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"
6093
#endif
6194

6295
#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 "/"
63105
--- lua/lutf8lib.c
64106
+++ lua/lutf8lib.c
65107
@@ -31,7 +31,9 @@

0 commit comments

Comments
 (0)