diff options
Diffstat (limited to 'miscutils/man.c')
-rw-r--r-- | miscutils/man.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/miscutils/man.c b/miscutils/man.c index 01155c8f0..9884325b7 100644 --- a/miscutils/man.c +++ b/miscutils/man.c | |||
@@ -209,8 +209,12 @@ static char **add_MANPATH(char **man_path_list, int *count_mp, char *path) | |||
209 | /* Do we already have path? */ | 209 | /* Do we already have path? */ |
210 | path_element = man_path_list; | 210 | path_element = man_path_list; |
211 | if (path_element) while (*path_element) { | 211 | if (path_element) while (*path_element) { |
212 | if (strcmp(*path_element, path) == 0) | 212 | if (strcmp(*path_element, path) == 0) { |
213 | /* Have path but haven't counted it, must be default */ | ||
214 | if (*count_mp == 0) | ||
215 | break; | ||
213 | goto skip; | 216 | goto skip; |
217 | } | ||
214 | path_element++; | 218 | path_element++; |
215 | } | 219 | } |
216 | man_path_list = xrealloc_vector(man_path_list, 4, *count_mp); | 220 | man_path_list = xrealloc_vector(man_path_list, 4, *count_mp); |