mirror of
https://github.com/lua/lua.git
synced 2025-01-14 05:43:00 +08:00
'notail' -> 'noextrachars' ('notail' may confuse with tail calls)
This commit is contained in:
parent
a6f465f558
commit
2b25489b47
10
lua.c
10
lua.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lua.c,v 1.174 2009/07/15 17:35:20 roberto Exp roberto $
|
** $Id: lua.c,v 1.175 2009/08/10 16:23:19 roberto Exp roberto $
|
||||||
** Lua stand-alone interpreter
|
** Lua stand-alone interpreter
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -265,7 +265,7 @@ static int handle_script (lua_State *L, char **argv, int n) {
|
|||||||
|
|
||||||
|
|
||||||
/* check that argument has no extra characters at the end */
|
/* check that argument has no extra characters at the end */
|
||||||
#define notail(x) {if ((x)[2] != '\0') return -1;}
|
#define noextrachars(x) {if ((x)[2] != '\0') return -1;}
|
||||||
|
|
||||||
|
|
||||||
static int collectargs (char **argv, int *pi, int *pv, int *pe) {
|
static int collectargs (char **argv, int *pi, int *pv, int *pe) {
|
||||||
@ -275,15 +275,15 @@ static int collectargs (char **argv, int *pi, int *pv, int *pe) {
|
|||||||
return i;
|
return i;
|
||||||
switch (argv[i][1]) { /* option */
|
switch (argv[i][1]) { /* option */
|
||||||
case '-':
|
case '-':
|
||||||
notail(argv[i]);
|
noextrachars(argv[i]);
|
||||||
return (argv[i+1] != NULL ? i+1 : 0);
|
return (argv[i+1] != NULL ? i+1 : 0);
|
||||||
case '\0':
|
case '\0':
|
||||||
return i;
|
return i;
|
||||||
case 'i':
|
case 'i':
|
||||||
notail(argv[i]);
|
noextrachars(argv[i]);
|
||||||
*pi = 1; /* go through */
|
*pi = 1; /* go through */
|
||||||
case 'v':
|
case 'v':
|
||||||
notail(argv[i]);
|
noextrachars(argv[i]);
|
||||||
*pv = 1;
|
*pv = 1;
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user