This patch set mainly tries to - Fix heap memory management issues. - Add test more cases with multiline option value and quotes in mind. - Fix issues of uci show, revert, add_list, del_list, batch commands.
My previous patch set for adding support for multiline option value support to UCI parser was not complete causing many unexpected problems which I was only aware of when doing a fresh installation. It's very wise of Felix for keeping that update only to uci.git repository at the moment, thus giving me the chance to discover those flaws and fix them at my best. BTW. is there some production tool I can use to batch updating v1 version of this patch series to replaced state? v2 <- v1 - Fix use-after-free bug caused by uci_realloc() in between consecutive call to next_arg(). - PATCH 2 fixes memory leaks found by valgrind. - PATCH 4 fixes EOF file check in uci_getln(). - PATCH 5 fixes error messages about unterminated quote string. - Do not quote list values that do not contain whitespace characters ("\x20\t\r\n"). This is mainly for maximum compatibility with current code using `uci get` on list options. Yousong Zhou (16): Fix a few style issues. Fix memory leaks found by using valgrind on test cases. file: fix use-after-free bug. file: fix EOF check. file: fix error string about "unterminated XXX". tests: remove straying echo in 020_get. tests: add more test coverage for `uci show' command. tests: add test coverage for `uci batch' command. tests: add test coverage for `uci revert' command. tests: add test coverage for uci list related commands. cli: fix printing option values occupying multiple lines. delta: add a simple duplication check when adding delta path. delta: preprocess delta line with uci_parse_argument(). delta: use a table for converting between UCI_CMD_XXX and prefixes. delta: fix outputing of delta entries occupying multiple lines. uci_internal: use comma expression for UCI_INTERNAL() call. .gitignore | 2 - cli.c | 53 +++++-- delta.c | 166 +++++++++----------- file.c | 58 ++++--- list.c | 2 +- test/references/add_list_changes.result | 4 + test/references/add_list_config.result | 6 + test/references/add_list_show.result | 3 + test/references/batch_set.result | 9 ++ test/references/del_list_config.result | 5 + test/references/del_list_multiline_config.result | 4 + test/references/revert_option.result | 3 + test/references/revert_option_multiline.result | 2 + test/references/show_parsing_multiline.data | 20 +++ .../show_parsing_multiline_option.result | 12 ++ .../show_parsing_multiline_package.result | 18 +++ .../show_parsing_multiline_section.result | 16 ++ test/tests.d/020_get | 1 - test/tests.d/050_show | 31 ++++ test/tests.d/060_batch | 17 ++ test/tests.d/070_revert | 28 ++++ test/tests.d/080_list | 52 ++++++ uci.h | 8 + uci_internal.h | 8 +- 24 files changed, 394 insertions(+), 134 deletions(-) create mode 100644 test/references/add_list_changes.result create mode 100644 test/references/add_list_config.result create mode 100644 test/references/add_list_show.result create mode 100644 test/references/batch_set.result create mode 100644 test/references/del_list_config.result create mode 100644 test/references/del_list_multiline_config.result create mode 100644 test/references/revert_option.result create mode 100644 test/references/revert_option_multiline.result create mode 100644 test/references/revert_section.result create mode 100644 test/references/show_parsing_multiline.data create mode 100644 test/references/show_parsing_multiline_option.result create mode 100644 test/references/show_parsing_multiline_package.result create mode 100644 test/references/show_parsing_multiline_section.result create mode 100644 test/tests.d/060_batch create mode 100644 test/tests.d/070_revert create mode 100644 test/tests.d/080_list -- 1.7.10.4 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel