man/man-db-2.6.3-section.dif

30 lines
908 B
Plaintext
Raw Normal View History

--- src/man.c
+++ src/man.c 2012-10-01 14:24:23.251006952 +0000
@@ -1368,7 +1368,7 @@ static inline const char *is_section (co
{
const char **vs;
- for (vs = section_list; *vs; vs++) {
+ for (vs = section_list; vs && *vs; vs++) {
if (STREQ (*vs, name))
return name;
/* allow e.g. 3perl but disallow 8139too and libfoo */
@@ -2943,7 +2943,7 @@ static int compare_candidates (const str
/* Find out whether lsource->ext is ahead of rsource->ext in
* section_list.
*/
- for (sp = section_list; *sp; ++sp) {
+ for (sp = section_list; sp && *sp; ++sp) {
if (!*(*sp + 1)) {
/* No extension */
if (!sec_left && **sp == *(lsource->ext))
@@ -3918,7 +3918,7 @@ static int man (const char *name, int *f
} else {
const char **sp;
- for (sp = section_list; *sp; sp++) {
+ for (sp = section_list; sp && *sp; sp++) {
char **mp;
for (mp = manpathlist; *mp; mp++)