summaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-28 10:41:09 +0000
committerRon Yorston <rmy@pobox.com>2019-03-28 10:41:09 +0000
commit215e01e70f13f28d1a4dbe297f095b25de04ee21 (patch)
tree8d5f945d6a756afbf552fe5ec94f6a11e2c5e6b6 /miscutils
parent7018ba917db63c493918af0a5bf2977480d52bc7 (diff)
downloadbusybox-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.
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/man.c4
1 files changed, 4 insertions, 0 deletions
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);