Matthias Schiffer
1f019ceea1
Fix various memory management issues
...
Consistently handle allocation failures. Some functions are changed to
return bool or int instead of void to allow returning an error.
Also fix a buffer size miscalculation in lua/uloop and use _exit() instead
of exit() on errors after forking.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2016-06-26 12:53:51 +02:00
Yousong Zhou
02db6d71b6
json_script: add "isdir" support
...
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2016-02-20 13:36:08 +01:00
Felix Fietkau
10429bccd0
json_script: allow non-string types in command arguments
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2015-11-08 20:19:08 +01:00
Felix Fietkau
3d45c47752
json_script: add support for aborting script processing
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2015-11-06 22:58:15 +01:00
Yousong Zhou
13b5c1d4ca
json_script: fix logic invert of handle_expr_not().
...
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2014-12-22 15:46:21 +01:00
Yousong Zhou
0d22684faa
json_script: remove unneed argument check before calling __json_script_file_free().
...
NULL check is present at the begining of function body.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2014-12-11 17:59:22 +01:00
Yousong Zhou
30e6cca939
json_script: fix eval_string().
...
- Fix handling of "%%".
- Fix length requirement when calling blobmsg_realloc_string_buffer().
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2014-12-11 17:59:02 +01:00
Felix Fietkau
1344d20ec0
json_script: fix a segfault in the file free handler
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-05-26 15:53:29 +02:00
Felix Fietkau
d416bf6655
json_script: add json_script_run_file()
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-04-28 17:54:25 +02:00
Felix Fietkau
178fe974af
json_script: implement json_script_eval_string
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-04-28 16:57:28 +02:00
Felix Fietkau
b2010c706c
json_script: do not rely on global includes for other libubox header files
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-02 16:21:11 +01:00
Felix Fietkau
38ea521911
add json_script, a minimalistic JSON based script interpreter
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-28 21:50:55 +01:00