From f477a741293673adad784c55a749031a290bd072 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 29 May 2005 11:58:14 +0000 Subject: r7075: added support for ARGV[] in ejs scripts (This used to be commit 3db568eb6bb383c4c1e1fd0c7f043a9914dcc3cc) --- source4/scripting/ejs/smbscript.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbscript.c') diff --git a/source4/scripting/ejs/smbscript.c b/source4/scripting/ejs/smbscript.c index c6b1b7a192..3378885147 100644 --- a/source4/scripting/ejs/smbscript.c +++ b/source4/scripting/ejs/smbscript.c @@ -37,8 +37,11 @@ void ejs_exception(const char *reason) MprVar result; char *emsg; TALLOC_CTX *mem_ctx = talloc_new(NULL); + const char **argv_list = NULL; + struct MprVar v; + int i; - if (argc != 2) { + if (argc < 2) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } @@ -67,6 +70,14 @@ void ejs_exception(const char *reason) exit(1); } + /* setup ARGV[] in the ejs environment */ + for (i=2;i