tcorrect sort order; do troff right - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 3844a3d978f02504be987e03a75c40a25bc6cefd
 (DIR) parent acc29ab200d6c19c90ba3ba244965fad8a3c201d
 (HTM) Author: rsc <devnull@localhost>
       Date:   Wed, 13 Jul 2005 10:45:47 +0000
       
       correct sort order; do troff right
       
       Diffstat:
         M bin/man                             |       5 +++--
       
       1 file changed, 3 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/bin/man b/bin/man
       t@@ -81,7 +81,7 @@ while(~ $d 0) {
                        shift
                }
                if not switch($1) {
       -                case -t ; fmt=dotroff ; shift
       +                case -t ; cmd=dotroff ; shift
                        case -n ; cmd=donroff ; shift
                        case -p ; cmd=doproof ; shift
                        case -P ; cmd=dopage ; shift
       t@@ -124,7 +124,8 @@ for(word){
        }
        if(~ $#allfiles 0)
                exit 'no man'
       -allfiles=`{ls $allfiles | sort -u >[2]/dev/null}
       +# complicated sort order: want 9p.3, 9p-cmdbuf.3, 9pclient.3
       +allfiles=`{ls $allfiles | sed 's/[.\-]/ &/g;s/\./ &/g' | sort -u | tr -d ' '}
        
        files=()
        for(i in $allfiles){