mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Check for hooks.js before trying to load it.
Check file_exists(path) before calling smjs_do_file(path) in smjs_load_hooks to fix an error message when there is no hooks.js, reported by zas.
This commit is contained in:
parent
8c9324cc37
commit
97b5b9cfe1
@ -14,6 +14,7 @@
|
||||
#include "scripting/smjs/elinks_object.h"
|
||||
#include "scripting/smjs/global_object.h"
|
||||
#include "scripting/smjs/smjs.h"
|
||||
#include "util/file.h"
|
||||
#include "util/string.h"
|
||||
|
||||
|
||||
@ -116,7 +117,8 @@ smjs_load_hooks(void)
|
||||
path = stracpy(CONFDIR "/" SMJS_HOOKS_FILENAME);
|
||||
}
|
||||
|
||||
smjs_do_file(path);
|
||||
if (file_exists(path))
|
||||
smjs_do_file(path);
|
||||
mem_free(path);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user