man: fix literal file suffix parsing regression
[dragonfly.git] / usr.bin / man / man.c
index aaf4bba..6ea0df2 100644 (file)
@@ -556,7 +556,8 @@ manual(char *page, struct manstate *mp, glob_t *pg)
 
                /* clip suffix for the suffix check below */
                p = strrchr(escpage, '/');
 
                /* clip suffix for the suffix check below */
                p = strrchr(escpage, '/');
-               p = strchr(p, '.');
+               while ((p = strchr(p, '.')) && !isdigit(p[1]))
+                       ++p;
                if (p)
                        p[0] = '\0';
 
                if (p)
                        p[0] = '\0';