[BACK]Return to cvsweb.cgi CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / cvsweb

Diff for /cvsweb/cvsweb.cgi between version 3.12 and 3.16

version 3.12, 2000/08/15 06:54:01 version 3.16, 2000/09/03 17:33:22
Line 41 
Line 41 
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.  # SUCH DAMAGE.
 #  #
 # $zId: cvsweb.cgi,v 1.93 2000/07/27 17:42:28 hzeller Exp $  # $zId: cvsweb.cgi,v 1.94 2000/08/24 06:41:22 hnordstrom Exp $
 # $Id$  # $Id$
 #  #
 ###  ###
Line 124  use Cwd;
Line 124  use Cwd;
 # User configuration is stored in  # User configuration is stored in
 $config = undef;  $config = undef;
   
 for ($ENV{CVSWEB_CONFIG}, '/usr/local/etc/cvsweb.conf', getcwd . '/cvsweb.conf') {  for ($ENV{CVSWEB_CONFIG},
   #     '/home/knu/etc/cvsweb.conf',
        '/usr/local/etc/cvsweb.conf',
        getcwd . '/cvsweb.conf') {
   $config = $_ if defined($_) && -r $_;    $config = $_ if defined($_) && -r $_;
 }  }
   
Line 717  elsif (-d $fullname) {
Line 720  elsif (-d $fullname) {
             print "<OPTION VALUE=\"\">All tags / default branch\n";              print "<OPTION VALUE=\"\">All tags / default branch\n";
             foreach my $tag (reverse sort { lc $a cmp lc $b } keys %tags) {              foreach my $tag (reverse sort { lc $a cmp lc $b } keys %tags) {
                 print "<OPTION",defined($input{only_with_tag}) &&                  print "<OPTION",defined($input{only_with_tag}) &&
                        $input{only_with_tag} eq $tag ? " SELECTED":"",                         $input{only_with_tag} eq $tag ? " SELECTED" : "",
                        ">$tag\n";                         ">$tag\n";
             }              }
             print "</SELECT>\n";              print "</SELECT>\n";
Line 753  elsif (-d $fullname) {
Line 756  elsif (-d $fullname) {
             printDiffSelect(0);              printDiffSelect(0);
             print "</td>";              print "</td>";
             print "<td>Show Attic files: ";              print "<td>Show Attic files: ";
             print "<INPUT NAME=hideattic TYPE=CHECKBOX", $input{'hideattic'}?" CHECKED":"",              print "<INPUT NAME=hideattic TYPE=CHECKBOX", $input{'hideattic'} ? " CHECKED" : "",
             "></td></tr>\n";              "></td></tr>\n";
             print "<tr><td align=center colspan=2><input type=submit value=\"Change Options\">";              print "<tr><td align=center colspan=2><input type=submit value=\"Change Options\">";
             print "</td></tr></table></center></FORM>\n";              print "</td></tr></table></center></FORM>\n";
Line 892  sub htmlify($;$) {
Line 895  sub htmlify($;$) {
         $string =~ s/>/&gt;/g;          $string =~ s/>/&gt;/g;
   
         # get URL's as link ..          # get URL's as link ..
         $string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`<A HREF="$1$2$3">$1$2$3</A>`;          $string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`<A HREF="$1$2$3">$1$2$3</A>`g;
         # get e-mails as link          # get e-mails as link
         $string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`<A HREF="mailto:$1">$1</A>`;          $string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`<A HREF="mailto:$1">$1</A>`g;
   
         # get #PR as link ..          # get #PR as link ..
         if ($pr && defined($prcgi)) {          if ($pr && defined($prcgi)) {
Line 909  sub spacedHtmlText($) {
Line 912  sub spacedHtmlText($) {
         local $_ = $_[0];          local $_ = $_[0];
   
         # Cut trailing spaces          # Cut trailing spaces
         s/\s+$//;          s/\s+\n$//;
   
         # Expand tabs          # Expand tabs
         s/\t+/' ' x (length($&) * $tabstop - length($`) % $tabstop)/e          s/\t+/' ' x (length($&) * $tabstop - length($`) % $tabstop)/e
Line 946  sub link($$) {
Line 949  sub link($$) {
   
 sub revcmp($$) {  sub revcmp($$) {
         my($rev1, $rev2) = @_;          my($rev1, $rev2) = @_;
   
           # make no comparison for a tag or a branch
           return 0 if $rev1 =~ /[^\d.]/ || $rev2 =~ /[^\d.]/;
   
         my(@r1) = split(/\./, $rev1);          my(@r1) = split(/\./, $rev1);
         my(@r2) = split(/\./, $rev2);          my(@r2) = split(/\./, $rev2);
         my($a,$b);          my($a,$b);
Line 1060  sub doAnnotate($$) {
Line 1067  sub doAnnotate($$) {
   
     # make sure the revisions a wellformed, for security      # make sure the revisions a wellformed, for security
     # reasons ..      # reasons ..
     if (!($rev =~ /^[\d\.]+$/)) {      if ($rev =~ /[^\w.]/) {
         &fatal("404 Not Found",          &fatal("404 Not Found",
                 "Malformed query \"$ENV{QUERY_STRING}\"");                  "Malformed query \"$ENV{QUERY_STRING}\"");
     }      }
Line 1211  sub doCheckout($$) {
Line 1218  sub doCheckout($$) {
     my ($mimetype,$revopt);      my ($mimetype,$revopt);
     my $fh = do {local(*FH);};      my $fh = do {local(*FH);};
   
       if ($rev eq 'HEAD' || $rev eq '.') {
           $rev = undef;
       }
   
     # make sure the revisions a wellformed, for security      # make sure the revisions a wellformed, for security
     # reasons ..      # reasons ..
     if (defined($rev) && !($rev =~ /^[\d\.]+$/)) {      if (defined($rev) && $rev =~ /[^\w.]/) {
         &fatal("404 Not Found",          &fatal("404 Not Found",
                 "Malformed query \"$ENV{QUERY_STRING}\"");                  "Malformed query \"$ENV{QUERY_STRING}\"");
     }      }
Line 1249  sub doCheckout($$) {
Line 1260  sub doCheckout($$) {
     # Safely for a child process to read from.      # Safely for a child process to read from.
     if (! open($fh, "-|")) { # child      if (! open($fh, "-|")) { # child
       open(STDERR, ">&STDOUT"); # Redirect stderr to stdout        open(STDERR, ">&STDOUT"); # Redirect stderr to stdout
       exec("cvs", "-d", $cvsroot, "co", "-p", $revopt, $where);        exec("cvs", "-Rld", $cvsroot, "co", "-p", $revopt, $where);
     }      }
 #===================================================================  #===================================================================
 #Checking out squid/src/ftp.c  #Checking out squid/src/ftp.c
Line 1366  sub doDiff($$$$$$) {
Line 1377  sub doDiff($$$$$$) {
             $rev2 = $tr2;              $rev2 = $tr2;
             $sym2 = "";              $sym2 = "";
         }          }
   
         # make sure the revisions a wellformed, for security          # make sure the revisions a wellformed, for security
         # reasons ..          # reasons ..
         if (!($rev1 =~ /^[\d\.]+$/) || !($rev2 =~ /^[\d\.]+$/)) {          if ($rev1 =~ /[^\w.]/ || $rev2 =~ /[^\w.]/) {
             &fatal("404 Not Found",              &fatal("404 Not Found",
                     "Malformed query \"$ENV{QUERY_STRING}\"");                      "Malformed query \"$ENV{QUERY_STRING}\"");
         }          }
Line 1410  sub doDiff($$$$$$) {
Line 1422  sub doDiff($$$$$$) {
   
         # apply special options          # apply special options
         if ($showfunc) {          if ($showfunc) {
             push @difftype, '-p';              push @difftype, '-p' if $f =~ /^[cHhu]$/;
   
             my($re1, $re2);              my($re1, $re2);
   
Line 2122  EOF
Line 2134  EOF
         print "</SELECT>\n";          print "</SELECT>\n";
         $diffrev = $revdisplayorder[0];          $diffrev = $revdisplayorder[0];
         $diffrev = $input{"r2"} if (defined($input{"r2"}));          $diffrev = $input{"r2"} if (defined($input{"r2"}));
         print "<INPUT TYPE=\"TEXT\" SIZE=\"$inputTextSize\" NAME=\"tr2\" VALUE=\"$diffrev\" onChange='docuement.diff_select.r2.selectedIndex=0'>\n";          print "<INPUT TYPE=\"TEXT\" SIZE=\"$inputTextSize\" NAME=\"tr2\" VALUE=\"$diffrev\" onChange='document.diff_select.r2.selectedIndex=0'>\n";
         print "<BR>Type of Diff should be a&nbsp;";          print "<BR>Type of Diff should be a&nbsp;";
         printDiffSelect(0);          printDiffSelect(0);
         print "<INPUT TYPE=SUBMIT VALUE=\"  Get Diffs  \">\n";          print "<INPUT TYPE=SUBMIT VALUE=\"  Get Diffs  \">\n";
Line 2370  sub navigateHeader($$$$$) {
Line 2382  sub navigateHeader($$$$$) {
     $swhere = urlencode($filename) if ($swhere eq "");      $swhere = urlencode($filename) if ($swhere eq "");
     print "<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">";      print "<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">";
     print "<HTML>\n<HEAD>\n";      print "<HTML>\n<HEAD>\n";
     print '<!-- CVSweb $zRevision: 1.93 $  $Revision$ -->';      print '<!-- CVSweb $zRevision: 1.94 $  $Revision$ -->';
     print "\n<TITLE>$path$filename - $title - $rev</TITLE></HEAD>\n";      print "\n<TITLE>$path$filename - $title - $rev</TITLE></HEAD>\n";
     print  "<BODY BGCOLOR=\"$backcolor\">\n";      print  "<BODY BGCOLOR=\"$backcolor\">\n";
     print "<table width=\"100%\" border=0 cellspacing=0 cellpadding=1 bgcolor=\"$navigationHeaderColor\">";      print "<table width=\"100%\" border=0 cellspacing=0 cellpadding=1 bgcolor=\"$navigationHeaderColor\">";
Line 2722  sub http_header(;$) {
Line 2734  sub http_header(;$) {
   
 sub html_header($) {  sub html_header($) {
     my ($title) = @_;      my ($title) = @_;
     my $version = '$zRevision: 1.93 $  $Revision$'; #'      my $version = '$zRevision: 1.94 $  $Revision$'; #'
     http_header();      http_header();
     print <<EOH;      print <<EOH;
 <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"  <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"

Legend:
Removed from v.3.12  
changed lines
  Added in v.3.16

CVSweb