diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-20 17:43:21 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-20 17:43:21 +0000 |
commit | 1e8034e61432cb3bd4bde1d7a13e809543a1e239 (patch) | |
tree | 06017ed43a6474419b5ce9c6aee50be71ff1cf8d | |
parent | 09aaf78ad51d95866972a926cb43bafa0c4a5c5e (diff) | |
download | busybox-w32-1e8034e61432cb3bd4bde1d7a13e809543a1e239.tar.gz busybox-w32-1e8034e61432cb3bd4bde1d7a13e809543a1e239.tar.bz2 busybox-w32-1e8034e61432cb3bd4bde1d7a13e809543a1e239.zip |
man: fix breakage: must not die on lines with < 2 tokens
-rw-r--r-- | miscutils/man.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/miscutils/man.c b/miscutils/man.c index 75af3d775..7ef5941a1 100644 --- a/miscutils/man.c +++ b/miscutils/man.c | |||
@@ -106,13 +106,15 @@ int man_main(int argc UNUSED_PARAM, char **argv) | |||
106 | if (parser) { | 106 | if (parser) { |
107 | /* go through man configuration file and search relevant paths, sections */ | 107 | /* go through man configuration file and search relevant paths, sections */ |
108 | char *token[2]; | 108 | char *token[2]; |
109 | while (config_read(parser, token, 2, 2, "# \t", PARSE_LAST_IS_GREEDY)) { | 109 | while (config_read(parser, token, 2, 0, "# \t", PARSE_LAST_IS_GREEDY)) { |
110 | if (!token[1]) | ||
111 | continue; | ||
110 | if (strcmp("MANPATH", token[0]) == 0) { | 112 | if (strcmp("MANPATH", token[0]) == 0) { |
111 | man_path_list = xrealloc_vector(man_path_list, 4, count_mp); | ||
112 | man_path_list[count_mp] = xstrdup(token[1]); | 113 | man_path_list[count_mp] = xstrdup(token[1]); |
113 | count_mp++; | 114 | count_mp++; |
114 | /* man_path_list is NULL terminated */ | 115 | /* man_path_list is NULL terminated */ |
115 | man_path_list[count_mp] = NULL; | 116 | man_path_list[count_mp] = NULL; |
117 | man_path_list = xrealloc_vector(man_path_list, 4, count_mp); | ||
116 | } | 118 | } |
117 | if (strcmp("MANSECT", token[0]) == 0) { | 119 | if (strcmp("MANSECT", token[0]) == 0) { |
118 | free(sec_list); | 120 | free(sec_list); |