diff options
| author | Ron Yorston <rmy@pobox.com> | 2017-08-23 10:32:46 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2017-08-23 10:32:46 +0100 |
| commit | 6abd18047bb07ff7846339fe13f26dc8c340967f (patch) | |
| tree | 31b7b4173a8b034ae53090eb80c3dc635683678b /miscutils | |
| parent | 4e337206b5ce0057a1330ed8e281a2b37a3bf8bb (diff) | |
| download | busybox-w32-6abd18047bb07ff7846339fe13f26dc8c340967f.tar.gz busybox-w32-6abd18047bb07ff7846339fe13f26dc8c340967f.tar.bz2 busybox-w32-6abd18047bb07ff7846339fe13f26dc8c340967f.zip | |
man: save path separator so it can be restored
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/man.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/miscutils/man.c b/miscutils/man.c index fb96cae02..6f74b5aaa 100644 --- a/miscutils/man.c +++ b/miscutils/man.c | |||
| @@ -199,8 +199,9 @@ 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 | |||
| 203 | #if ENABLE_PLATFORM_MINGW32 | 202 | #if ENABLE_PLATFORM_MINGW32 |
| 203 | char save; | ||
| 204 | |||
| 204 | next_path = (char *)next_path_sep(path); | 205 | next_path = (char *)next_path_sep(path); |
| 205 | #else | 206 | #else |
| 206 | next_path = strchr(path, ':'); | 207 | next_path = strchr(path, ':'); |
| @@ -208,6 +209,9 @@ static char **add_MANPATH(char **man_path_list, int *count_mp, char *path) | |||
| 208 | if (next_path) { | 209 | if (next_path) { |
| 209 | if (next_path == path) /* "::"? */ | 210 | if (next_path == path) /* "::"? */ |
| 210 | goto next; | 211 | goto next; |
| 212 | #if ENABLE_PLATFORM_MINGW32 | ||
| 213 | save = *next_path; | ||
| 214 | #endif | ||
| 211 | *next_path = '\0'; | 215 | *next_path = '\0'; |
| 212 | } | 216 | } |
| 213 | /* Do we already have path? */ | 217 | /* Do we already have path? */ |
| @@ -226,7 +230,11 @@ static char **add_MANPATH(char **man_path_list, int *count_mp, char *path) | |||
| 226 | if (!next_path) | 230 | if (!next_path) |
| 227 | break; | 231 | break; |
| 228 | /* "path" may be a result of getenv(), be nice and don't mangle it */ | 232 | /* "path" may be a result of getenv(), be nice and don't mangle it */ |
| 233 | #if ENABLE_PLATFORM_MINGW32 | ||
| 234 | *next_path = save; | ||
| 235 | #else | ||
| 229 | *next_path = ':'; | 236 | *next_path = ':'; |
| 237 | #endif | ||
| 230 | next: | 238 | next: |
| 231 | path = next_path + 1; | 239 | path = next_path + 1; |
| 232 | } | 240 | } |
