From 3d32f310e8e8e92fbc4d72801a28c999d628c22a Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Thu, 20 Mar 1997 01:36:20 +0000 Subject: [PATCH] Allow module name followed by a filename, e.g. http://www.freebsd.org/cgi/cvsweb.cgi/mrouted/main.c Fix the revision comparison function; diff's between branch and head are no longer reversed. --- data/cgi/cvsweb.cgi | 7 +++++-- en/cgi/cvsweb.cgi | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/data/cgi/cvsweb.cgi b/data/cgi/cvsweb.cgi index d80f7b9ad1..eb17b49f66 100755 --- a/data/cgi/cvsweb.cgi +++ b/data/cgi/cvsweb.cgi @@ -469,11 +469,14 @@ if (-d $fullname) { print &html_footer; print "\n"; } else { + # Assume it's a module name with a potential path following it. + $where =~ s|/.*||; + $xtra = $&; # Is there an indexed version of modules? if (open(MODULES, "$cvsroot/CVSROOT/modules")) { while () { if (/^${where}\s+(\S+)/o && -d "${cvsroot}/$1") { - &redirect($scriptname . '/' . $1); + &redirect($scriptname . '/' . $1 . $xtra); } } } @@ -502,7 +505,7 @@ sub revcmp { local(@r2) = split(/\./, $rev2); local($a,$b); - while (($a = pop(@r1)) && ($b = pop(@r2))) { + while (($a = shift(@r1)) && ($b = shift(@r2))) { if ($a != $b) { return $a <=> $b; } diff --git a/en/cgi/cvsweb.cgi b/en/cgi/cvsweb.cgi index d80f7b9ad1..eb17b49f66 100755 --- a/en/cgi/cvsweb.cgi +++ b/en/cgi/cvsweb.cgi @@ -469,11 +469,14 @@ if (-d $fullname) { print &html_footer; print "\n"; } else { + # Assume it's a module name with a potential path following it. + $where =~ s|/.*||; + $xtra = $&; # Is there an indexed version of modules? if (open(MODULES, "$cvsroot/CVSROOT/modules")) { while () { if (/^${where}\s+(\S+)/o && -d "${cvsroot}/$1") { - &redirect($scriptname . '/' . $1); + &redirect($scriptname . '/' . $1 . $xtra); } } } @@ -502,7 +505,7 @@ sub revcmp { local(@r2) = split(/\./, $rev2); local($a,$b); - while (($a = pop(@r1)) && ($b = pop(@r2))) { + while (($a = shift(@r1)) && ($b = shift(@r2))) { if ($a != $b) { return $a <=> $b; }