diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-19 22:57:00 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-19 22:57:00 +0000 |
| commit | dcb3fcb042612bfbb311a488379c65024bafd52b (patch) | |
| tree | ce29b24ad433b8d8a4e0b450ca458bcde69a9a88 /libbb | |
| parent | c29684afd61b841c93517f378aaa1fd7750b038d (diff) | |
| download | busybox-w32-dcb3fcb042612bfbb311a488379c65024bafd52b.tar.gz busybox-w32-dcb3fcb042612bfbb311a488379c65024bafd52b.tar.bz2 busybox-w32-dcb3fcb042612bfbb311a488379c65024bafd52b.zip | |
libbb: config_read() update
Diffstat (limited to 'libbb')
| -rw-r--r-- | libbb/parse_config.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/parse_config.c b/libbb/parse_config.c index 3945501ad..8d7c97eb1 100644 --- a/libbb/parse_config.c +++ b/libbb/parse_config.c | |||
| @@ -75,10 +75,10 @@ static void config_free_data(parser_t *const parser) | |||
| 75 | { | 75 | { |
| 76 | free(parser->line); | 76 | free(parser->line); |
| 77 | parser->line = NULL; | 77 | parser->line = NULL; |
| 78 | USE_FEATURE_PARSE_COPY( | 78 | if (PARSE_KEEP_COPY) { /* compile-time constant */ |
| 79 | free(parser->data); | 79 | free(parser->data); |
| 80 | parser->data = NULL; | 80 | parser->data = NULL; |
| 81 | ) | 81 | } |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | void FAST_FUNC config_close(parser_t *parser) | 84 | void FAST_FUNC config_close(parser_t *parser) |
| @@ -179,9 +179,9 @@ int FAST_FUNC config_read(parser_t *parser, char **tokens, unsigned flags, const | |||
| 179 | 179 | ||
| 180 | // store line | 180 | // store line |
| 181 | parser->line = line = xrealloc(line, ii + 1); | 181 | parser->line = line = xrealloc(line, ii + 1); |
| 182 | USE_FEATURE_PARSE_COPY( | 182 | if (flags & PARSE_KEEP_COPY) { |
| 183 | parser->data = xstrdup(line); | 183 | parser->data = xstrdup(line); |
| 184 | ) | 184 | } |
| 185 | 185 | ||
| 186 | /* now split line to tokens */ | 186 | /* now split line to tokens */ |
| 187 | ntokens--; // now it's max allowed token no | 187 | ntokens--; // now it's max allowed token no |
