Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/man add more compression suffixes and local suffixes.



details:   https://anonhg.NetBSD.org/src/rev/ba034617f305
branches:  trunk
changeset: 790411:ba034617f305
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Oct 06 17:14:49 2013 +0000

description:
add more compression suffixes and local suffixes.

diffstat:

 usr.bin/man/man.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 0c6ac7db0bac -r ba034617f305 usr.bin/man/man.c
--- a/usr.bin/man/man.c Sun Oct 06 16:43:41 2013 +0000
+++ b/usr.bin/man/man.c Sun Oct 06 17:14:49 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: man.c,v 1.58 2013/10/06 16:43:41 christos Exp $        */
+/*     $NetBSD: man.c,v 1.59 2013/10/06 17:14:49 christos Exp $        */
 
 /*
  * Copyright (c) 1987, 1993, 1994, 1995
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)man.c      8.17 (Berkeley) 1/31/95";
 #else
-__RCSID("$NetBSD: man.c,v 1.58 2013/10/06 16:43:41 christos Exp $");
+__RCSID("$NetBSD: man.c,v 1.59 2013/10/06 17:14:49 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -556,11 +556,13 @@
 
                /* clip suffix for the suffix check below */
                if ((p = strrchr(escpage, '.')) != NULL) {
-                       if (strcmp(p, ".gz") == 0 || strcmp(p, ".bz2") == 0) {
+                       /* Should get suffixes from the configuration file */
+                       if (strcmp(p, ".gz") == 0 || strcmp(p, ".bz2") == 0 ||
+                           strcmp(p, ".Z") == 0 || strcmp(p, ".xz") == 0) {
                                *p = '\0';
                                p = strrchr(escpage, '.');
                        }
-                       if (p && isdigit((unsigned char)p[1]))
+                       if (p && strchr("0123456789ln", p[1]) != NULL)
                                *p = '\0';
                }
 



Home | Main Index | Thread Index | Old Index