mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
r7223: Advance script past interpreter line.
This commit is contained in:
parent
615618f192
commit
31b9fadbed
@ -83,6 +83,17 @@ void ejs_exception(const char *reason)
|
||||
/* load the script and advance past interpreter line*/
|
||||
script = file_load(argv[1], &script_size);
|
||||
|
||||
if ((script_size > 2) && script[0] == '#' && script[1] == '!') {
|
||||
script += 2;
|
||||
script_size -= 2;
|
||||
while (script_size) {
|
||||
if (*script == '\r' || *script == '\n')
|
||||
break;
|
||||
script++;
|
||||
script_size--;
|
||||
}
|
||||
}
|
||||
|
||||
/* run the script */
|
||||
if (ejsEvalScript(eid, script, &result, &emsg) == -1) {
|
||||
fprintf(stderr, "smbscript: ejsEvalScript(): %s\n", emsg);
|
||||
|
Loading…
Reference in New Issue
Block a user