diff options
-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 fd5d90c1a..b2d42b043 100644 --- a/miscutils/man.c +++ b/miscutils/man.c | |||
@@ -208,8 +208,12 @@ static char **add_MANPATH(char **man_path_list, int *count_mp, char *path) | |||
208 | /* Do we already have path? */ | 208 | /* Do we already have path? */ |
209 | path_element = man_path_list; | 209 | path_element = man_path_list; |
210 | if (path_element) while (*path_element) { | 210 | if (path_element) while (*path_element) { |
211 | if (strcmp(*path_element, path) == 0) | 211 | if (strcmp(*path_element, path) == 0) { |
212 | /* Have path but haven't counted it, must be default */ | ||
213 | if (*count_mp == 0) | ||
214 | break; | ||
212 | goto skip; | 215 | goto skip; |
216 | } | ||
213 | path_element++; | 217 | path_element++; |
214 | } | 218 | } |
215 | man_path_list = xrealloc_vector(man_path_list, 4, *count_mp); | 219 | man_path_list = xrealloc_vector(man_path_list, 4, *count_mp); |