$OpenBSD: patch-cvsweb_cgi,v 1.2 2000/10/12 19:53:30 naddy Exp $
--- cvsweb.cgi.orig	Sat Oct  7 10:00:22 2000
+++ cvsweb.cgi	Tue Oct 10 23:12:30 2000
@@ -1,4 +1,4 @@
-#!/usr/bin/perl5 -ws
+#!/usr/bin/perl -ws
 #
 # cvsweb - a CGI interface to CVS trees.
 #
@@ -59,7 +59,7 @@ use vars qw (
     $checkoutMagic $doCheckout $scriptname $scriptwhere
     $where $pathinfo $Browser $nofilelinks $maycompress @stickyvars
     %funcline_regexp $is_mod_perl
-    $is_lynx $is_w3m $is_msie $is_mozilla3 $is_textbased
+    $is_links $is_lynx $is_w3m $is_msie $is_mozilla3 $is_textbased
     %input $query $barequery $sortby $bydate $byrev $byauthor
     $bylog $byfile $hr_default $logsort $cvstree $cvsroot
     $mimetype $defaultTextPlain $defaultViewable $allow_compress
@@ -129,7 +129,7 @@ use Cwd;
 # Locations to search for user configuration, in order:
 for (
      $ENV{CVSWEB_CONFIG},
-     '/usr/local/etc/cvsweb.conf',
+     '%%SYSCONFDIR%%/cvsweb.conf',
      getcwd() . '/cvsweb.conf'
     ) {
     $config = $_ if defined($_) && -r $_;
@@ -196,12 +196,13 @@ $is_mod_perl = defined($ENV{MOD_PERL});
 # per file, so disable the link at the icon
 # in this case:
 $Browser = $ENV{HTTP_USER_AGENT};
+$is_links = ($Browser =~ m`^Links `);
 $is_lynx = ($Browser =~ m`^Lynx/`i);
 $is_w3m = ($Browser =~ m`^w3m/`i);
 $is_msie = ($Browser =~ m`MSIE`);
 $is_mozilla3 = ($Browser =~ m`^Mozilla/[3-9]`);
 
-$is_textbased = ($is_lynx || $is_w3m);
+$is_textbased = ($is_links || $is_lynx || $is_w3m);
 
 $nofilelinks = $is_textbased;
 
@@ -1255,7 +1256,7 @@ sub doAnnotate($$) {
 	    }
 	    else {
 		$revprint = sprintf('%-8s', $lrev);
-		$revprint =~ s`\S+`<a href="${scriptwhere}${barequery}#rev$1">$&</A>`;	# `		
+		$revprint =~ s`(\S+)`<a href="${scriptwhere}${query}#rev$1">$1</A>`;
 		$oldLusr = '';
 	    }
 	    if ($lusr eq $oldLusr) {
