From 80bac182db4bba6fc0dcfdb0d4d6abe4183083d1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 24 Mar 2003 09:40:01 -0300 Subject: [PATCH] do not mix `--help' with `--' --- lua.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua.c b/lua.c index 6f0c8d07..39571379 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.119 2003/03/17 13:01:48 roberto Exp roberto $ +** $Id: lua.c,v 1.120 2003/03/19 21:15:18 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -310,6 +310,10 @@ static int handle_argv (char *argv[], int *interactive) { if (argv[i][0] != '-') break; /* not an option? */ switch (argv[i][1]) { /* option */ case '-': { /* `--' */ + if (argv[i][2] != '\0') { + print_usage(); + return 1; + } i++; /* skip this argument */ goto endloop; /* stop handling arguments */ }