diff options
Diffstat (limited to 'miscutils/man.c')
-rw-r--r-- | miscutils/man.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/miscutils/man.c b/miscutils/man.c index 01155c8f0..fd5d90c1a 100644 --- a/miscutils/man.c +++ b/miscutils/man.c | |||
@@ -199,8 +199,7 @@ static char **add_MANPATH(char **man_path_list, int *count_mp, char *path) | |||
199 | if (path) while (*path) { | 199 | if (path) while (*path) { |
200 | char *next_path; | 200 | char *next_path; |
201 | char **path_element; | 201 | char **path_element; |
202 | 202 | next_path = strchr(path, PATH_SEP); | |
203 | next_path = strchr(path, ':'); | ||
204 | if (next_path) { | 203 | if (next_path) { |
205 | if (next_path == path) /* "::"? */ | 204 | if (next_path == path) /* "::"? */ |
206 | goto next; | 205 | goto next; |
@@ -222,7 +221,7 @@ static char **add_MANPATH(char **man_path_list, int *count_mp, char *path) | |||
222 | if (!next_path) | 221 | if (!next_path) |
223 | break; | 222 | break; |
224 | /* "path" may be a result of getenv(), be nice and don't mangle it */ | 223 | /* "path" may be a result of getenv(), be nice and don't mangle it */ |
225 | *next_path = ':'; | 224 | *next_path = PATH_SEP; |
226 | next: | 225 | next: |
227 | path = next_path + 1; | 226 | path = next_path + 1; |
228 | } | 227 | } |
@@ -302,6 +301,16 @@ int man_main(int argc UNUSED_PARAM, char **argv) | |||
302 | } | 301 | } |
303 | config_close(parser); | 302 | config_close(parser); |
304 | 303 | ||
304 | #if ENABLE_PLATFORM_MINGW32 | ||
305 | { | ||
306 | char *exepath = xstrdup(bb_busybox_exec_path); | ||
307 | char *relpath = concat_path_file(dirname(exepath), "man"); | ||
308 | man_path_list = add_MANPATH(man_path_list, &count_mp, relpath); | ||
309 | free(relpath); | ||
310 | free(exepath); | ||
311 | } | ||
312 | #endif | ||
313 | |||
305 | { | 314 | { |
306 | /* environment overrides setting from man.config */ | 315 | /* environment overrides setting from man.config */ |
307 | char *env_pager = getenv("MANPAGER"); | 316 | char *env_pager = getenv("MANPAGER"); |