aboutsummaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/liolib.c b/liolib.c
index 60ab1bfa..79516724 100644
--- a/liolib.c
+++ b/liolib.c
@@ -52,12 +52,6 @@ static int l_checkmode (const char *mode) {
52** ======================================================= 52** =======================================================
53*/ 53*/
54 54
55#if !defined(l_checkmodep)
56/* By default, Lua accepts only "r" or "w" as mode */
57#define l_checkmodep(m) ((m[0] == 'r' || m[0] == 'w') && m[1] == '\0')
58#endif
59
60
61#if !defined(l_popen) /* { */ 55#if !defined(l_popen) /* { */
62 56
63#if defined(LUA_USE_POSIX) /* { */ 57#if defined(LUA_USE_POSIX) /* { */
@@ -70,6 +64,12 @@ static int l_checkmode (const char *mode) {
70#define l_popen(L,c,m) (_popen(c,m)) 64#define l_popen(L,c,m) (_popen(c,m))
71#define l_pclose(L,file) (_pclose(file)) 65#define l_pclose(L,file) (_pclose(file))
72 66
67#if !defined(l_checkmodep)
68/* Windows accepts "[rw][bt]?" as valid modes */
69#define l_checkmodep(m) ((m[0] == 'r' || m[0] == 'w') && \
70 (m[1] == '\0' || ((m[1] == 'b' || m[1] == 't') && m[2] == '\0')))
71#endif
72
73#else /* }{ */ 73#else /* }{ */
74 74
75/* ISO C definitions */ 75/* ISO C definitions */
@@ -83,6 +83,12 @@ static int l_checkmode (const char *mode) {
83 83
84#endif /* } */ 84#endif /* } */
85 85
86
87#if !defined(l_checkmodep)
88/* By default, Lua accepts only "r" or "w" as valid modes */
89#define l_checkmodep(m) ((m[0] == 'r' || m[0] == 'w') && m[1] == '\0')
90#endif
91
86/* }====================================================== */ 92/* }====================================================== */
87 93
88 94