mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
r7223: Advance script past interpreter line.
(This used to be commit 31b9fadbed
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
042ab1adbe
commit
c1b95bd467
@ -83,6 +83,17 @@ void ejs_exception(const char *reason)
|
|||||||
/* load the script and advance past interpreter line*/
|
/* load the script and advance past interpreter line*/
|
||||||
script = file_load(argv[1], &script_size);
|
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 */
|
/* run the script */
|
||||||
if (ejsEvalScript(eid, script, &result, &emsg) == -1) {
|
if (ejsEvalScript(eid, script, &result, &emsg) == -1) {
|
||||||
fprintf(stderr, "smbscript: ejsEvalScript(): %s\n", emsg);
|
fprintf(stderr, "smbscript: ejsEvalScript(): %s\n", emsg);
|
||||||
|
Reference in New Issue
Block a user