summaryrefslogtreecommitdiff
path: root/source4/lib/ejs/ejs.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-06-03 07:47:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:26 -0500
commit0253adcab3157ec73cc96ad74b19faa2c87e067a (patch)
treeeee6899cbb8af08bfd16c68b0b740dbb4346bd06 /source4/lib/ejs/ejs.c
parentb82d8c9928f7a39dbc552f99e1128e736d050622 (diff)
downloadsamba-0253adcab3157ec73cc96ad74b19faa2c87e067a.tar.gz
samba-0253adcab3157ec73cc96ad74b19faa2c87e067a.tar.bz2
samba-0253adcab3157ec73cc96ad74b19faa2c87e067a.zip
r7213: Add a small bit to the ejs parser to ignore a #!/path/to/interpreter
as the first line of the script. This allows smbscript to be used as an interpreter. (This used to be commit 875c8164096e7334de25cc57ac4b8bdc39b9c46b)
Diffstat (limited to 'source4/lib/ejs/ejs.c')
-rw-r--r--source4/lib/ejs/ejs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/lib/ejs/ejs.c b/source4/lib/ejs/ejs.c
index 41af795370..d0eaf6e389 100644
--- a/source4/lib/ejs/ejs.c
+++ b/source4/lib/ejs/ejs.c
@@ -418,8 +418,10 @@ int ejsEvalScript(EjsId eid, char *script, MprVar *vp, char **emsg)
endlessLoopTest = NULL;
ep->exitStatus = 0;
+ ejsParse(ep, EJS_STATE_BEGIN, EJS_FLAGS_EXE); /* Skip over #! */
+
do {
- state = ejsParse(ep, EJS_STATE_BEGIN, EJS_FLAGS_EXE);
+ state = ejsParse(ep, EJS_STATE_STMT, EJS_FLAGS_EXE);
if (state == EJS_STATE_RET) {
state = EJS_STATE_EOF;