diff options
Diffstat (limited to 'libbb/parse_config.c')
-rw-r--r-- | libbb/parse_config.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libbb/parse_config.c b/libbb/parse_config.c index d1b29218b..83dc997f6 100644 --- a/libbb/parse_config.c +++ b/libbb/parse_config.c | |||
@@ -66,8 +66,7 @@ parser_t* FAST_FUNC config_open2(const char *filename, FILE* FAST_FUNC (*fopen_f | |||
66 | parser->fp = fopen_func(filename); | 66 | parser->fp = fopen_func(filename); |
67 | if (parser->fp) | 67 | if (parser->fp) |
68 | return parser; | 68 | return parser; |
69 | if (ENABLE_FEATURE_CLEAN_UP) | 69 | free(parser); |
70 | free(parser); | ||
71 | return NULL; | 70 | return NULL; |
72 | } | 71 | } |
73 | 72 | ||
@@ -212,6 +211,19 @@ int FAST_FUNC config_read(parser_t *parser, char **tokens, unsigned flags, const | |||
212 | if ((flags & (PARSE_DONT_REDUCE|PARSE_DONT_TRIM)) || *line) { | 211 | if ((flags & (PARSE_DONT_REDUCE|PARSE_DONT_TRIM)) || *line) { |
213 | //bb_info_msg("N[%d] T[%s]", ii, line); | 212 | //bb_info_msg("N[%d] T[%s]", ii, line); |
214 | tokens[ii++] = line; | 213 | tokens[ii++] = line; |
214 | // process escapes in token | ||
215 | if (flags & PARSE_ESCAPE) { | ||
216 | char *s = line; | ||
217 | while (*s) { | ||
218 | if (*s == '\\') { | ||
219 | s++; | ||
220 | *line++ = bb_process_escape_sequence((const char **)&s); | ||
221 | } else { | ||
222 | *line++ = *s++; | ||
223 | } | ||
224 | } | ||
225 | *line = '\0'; | ||
226 | } | ||
215 | } | 227 | } |
216 | line = q; | 228 | line = q; |
217 | //bb_info_msg("A[%s]", line); | 229 | //bb_info_msg("A[%s]", line); |