aboutsummaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/liolib.c b/liolib.c
index f885be25..db2f01c2 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.148 2015/11/23 11:36:11 roberto Exp roberto $ 2** $Id: liolib.c,v 2.149 2016/05/02 14:03:19 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -37,10 +37,11 @@
37#endif 37#endif
38 38
39/* Check whether 'mode' matches '[rwa]%+?[L_MODEEXT]*' */ 39/* Check whether 'mode' matches '[rwa]%+?[L_MODEEXT]*' */
40#define l_checkmode(mode) \ 40static int l_checkmode (const char *mode) {
41 (*mode != '\0' && strchr("rwa", *(mode++)) != NULL && \ 41 return (*mode != '\0' && strchr("rwa", *(mode++)) != NULL &&
42 (*mode != '+' || (++mode, 1)) && /* skip if char is '+' */ \ 42 (*mode != '+' || (++mode, 1)) && /* skip if char is '+' */
43 (strspn(mode, L_MODEEXT) == strlen(mode))) 43 (strspn(mode, L_MODEEXT) == strlen(mode))); /* check extensions */
44}
44 45
45#endif 46#endif
46 47