diff options
author | Ron Yorston <rmy@pobox.com> | 2019-03-28 10:41:09 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-03-28 10:41:09 +0000 |
commit | 215e01e70f13f28d1a4dbe297f095b25de04ee21 (patch) | |
tree | 8d5f945d6a756afbf552fe5ec94f6a11e2c5e6b6 | |
parent | 7018ba917db63c493918af0a5bf2977480d52bc7 (diff) | |
download | busybox-w32-215e01e70f13f28d1a4dbe297f095b25de04ee21.tar.gz busybox-w32-215e01e70f13f28d1a4dbe297f095b25de04ee21.tar.bz2 busybox-w32-215e01e70f13f28d1a4dbe297f095b25de04ee21.zip |
man: proper handling of default path and config file
Don't overwrite the default path when the path relative to the
executable is added.
Remove trailing carriage returns when parsing the configuration
file.
-rw-r--r-- | libbb/parse_config.c | 4 | ||||
-rw-r--r-- | miscutils/man.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libbb/parse_config.c b/libbb/parse_config.c index 8701b010c..f7a2b81b9 100644 --- a/libbb/parse_config.c +++ b/libbb/parse_config.c | |||
@@ -115,6 +115,10 @@ static int get_line_with_continuation(parser_t *parser) | |||
115 | parser->lineno++; | 115 | parser->lineno++; |
116 | if (line[len - 1] == '\n') | 116 | if (line[len - 1] == '\n') |
117 | len--; | 117 | len--; |
118 | #if ENABLE_PLATFORM_MINGW32 | ||
119 | if (line[len - 1] == '\r') | ||
120 | len--; | ||
121 | #endif | ||
118 | if (len == 0 || line[len - 1] != '\\') | 122 | if (len == 0 || line[len - 1] != '\\') |
119 | break; | 123 | break; |
120 | len--; | 124 | len--; |
diff --git a/miscutils/man.c b/miscutils/man.c index b2d42b043..3c1a79085 100644 --- a/miscutils/man.c +++ b/miscutils/man.c | |||
@@ -309,6 +309,10 @@ int man_main(int argc UNUSED_PARAM, char **argv) | |||
309 | { | 309 | { |
310 | char *exepath = xstrdup(bb_busybox_exec_path); | 310 | char *exepath = xstrdup(bb_busybox_exec_path); |
311 | char *relpath = concat_path_file(dirname(exepath), "man"); | 311 | char *relpath = concat_path_file(dirname(exepath), "man"); |
312 | if (count_mp == 0) { | ||
313 | /* default must match path set above */ | ||
314 | man_path_list = add_MANPATH(man_path_list, &count_mp, "/usr/man"); | ||
315 | } | ||
312 | man_path_list = add_MANPATH(man_path_list, &count_mp, relpath); | 316 | man_path_list = add_MANPATH(man_path_list, &count_mp, relpath); |
313 | free(relpath); | 317 | free(relpath); |
314 | free(exepath); | 318 | free(exepath); |