*: conversion to config parser
function old new delta
config_read 540 597 +57
config_open2 41 44 +3
rtnl_rtprot_initialize 70 66 -4
rtnl_rttable_initialize 78 73 -5
rtnl_rtscope_initialize 88 83 -5
rtnl_rtrealm_initialize 48 43 -5
rtnl_rtdsfield_initialize 48 43 -5
process_module 566 560 -6
bbunpack 391 383 -8
rtnl_tab_initialize 279 121 -158
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/8 up/down: 60/-196) Total: -136 bytes
diff --git a/libbb/parse_config.c b/libbb/parse_config.c
index d1b2921..83dc997 100644
--- a/libbb/parse_config.c
+++ b/libbb/parse_config.c
@@ -66,8 +66,7 @@
parser->fp = fopen_func(filename);
if (parser->fp)
return parser;
- if (ENABLE_FEATURE_CLEAN_UP)
- free(parser);
+ free(parser);
return NULL;
}
@@ -212,6 +211,19 @@
if ((flags & (PARSE_DONT_REDUCE|PARSE_DONT_TRIM)) || *line) {
//bb_info_msg("N[%d] T[%s]", ii, line);
tokens[ii++] = line;
+ // process escapes in token
+ if (flags & PARSE_ESCAPE) {
+ char *s = line;
+ while (*s) {
+ if (*s == '\\') {
+ s++;
+ *line++ = bb_process_escape_sequence((const char **)&s);
+ } else {
+ *line++ = *s++;
+ }
+ }
+ *line = '\0';
+ }
}
line = q;
//bb_info_msg("A[%s]", line);