aboutsummaryrefslogtreecommitdiff
path: root/miscutils/man.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/man.c')
-rw-r--r--miscutils/man.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/miscutils/man.c b/miscutils/man.c
index 3c1a79085..0bc11e623 100644
--- a/miscutils/man.c
+++ b/miscutils/man.c
@@ -253,11 +253,22 @@ int man_main(int argc UNUSED_PARAM, char **argv)
253 int cur_mp; 253 int cur_mp;
254 int opt, not_found; 254 int opt, not_found;
255 char *token[2]; 255 char *token[2];
256#if ENABLE_PLATFORM_MINGW32
257 char **ptr;
258#endif
256 259
257 INIT_G(); 260 INIT_G();
258 261
259 opt = getopt32(argv, "^+" "aw" "\0" "-1"/*at least one arg*/); 262 opt = getopt32(argv, "^+" "aw" "\0" "-1"/*at least one arg*/);
260 argv += optind; 263 argv += optind;
264#if ENABLE_PLATFORM_MINGW32
265 /* add system drive prefix to filenames, if necessary */
266 for (ptr = argv; *ptr; ++ptr) {
267 if (strchr(*ptr, '/') || strchr(*ptr, '\\'))
268 *ptr = xabsolute_path(*ptr);
269 }
270 chdir_system_drive();
271#endif
261 272
262 sec_list = xstrdup("0p:1:1p:2:3:3p:4:5:6:7:8:9"); 273 sec_list = xstrdup("0p:1:1p:2:3:3p:4:5:6:7:8:9");
263 274
@@ -311,7 +322,8 @@ int man_main(int argc UNUSED_PARAM, char **argv)
311 char *relpath = concat_path_file(dirname(exepath), "man"); 322 char *relpath = concat_path_file(dirname(exepath), "man");
312 if (count_mp == 0) { 323 if (count_mp == 0) {
313 /* default must match path set above */ 324 /* default must match path set above */
314 man_path_list = add_MANPATH(man_path_list, &count_mp, "/usr/man"); 325 man_path_list = add_MANPATH(man_path_list, &count_mp,
326 (char *)"/usr/man");
315 } 327 }
316 man_path_list = add_MANPATH(man_path_list, &count_mp, relpath); 328 man_path_list = add_MANPATH(man_path_list, &count_mp, relpath);
317 free(relpath); 329 free(relpath);