History

Lua 5.2.0-work5

Lua Team committed 16 years ago

Commit 2ce62c01 parent 6ff498440 files · +1099 −765Browse files

Showing the changes to src/lua.c (1 of 40 files). Show all

Unified · Split

src/lua.c+7−6
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lua.c,v 1.192 2010/07/25 15:03:37 roberto Exp $
2+** $Id: lua.c,v 1.194 2010/10/25 19:01:37 roberto Exp $
33 ** Lua stand-alone interpreter
44 ** See Copyright Notice in lua.h
55 */
@@ -369,10 +369,11 @@ static int collectargs (char **argv, int *pi, int *pv, int *pe) { · 363 unmodified lines
369369 break;
370370 case 'e':
371371 *pe = 1; /* go through */
372− case 'l':
373− if (argv[i][2] == '\0') {
374− i++;
375− if (argv[i] == NULL) return -(i - 1);
372+ case 'l': /* both options need an argument */
373+ if (argv[i][2] == '\0') { /* no concatenated argument? */
374+ i++; /* try next 'argv' */
375+ if (argv[i] == NULL || argv[i][0] == '-')
376+ return -(i - 1); /* no next argument or it is another option */
376377 }
377378 break;
378379 default: /* invalid option; return its index... */
@@ -427,7 +428,7 @@ static int handle_luainit (lua_State *L) { · 48 unmodified lines
427428
428429
429430 static int pmain (lua_State *L) {
430− int argc = lua_tointeger(L, 1);
431+ int argc = (int)lua_tointeger(L, 1);
431432 char **argv = (char **)lua_touserdata(L, 2);
432433 int script;
433434 int has_i = 0, has_v = 0, has_e = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t