From owner-freebsd-cvsweb@FreeBSD.ORG Tue Nov 16 21:28:09 2004 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B567316A4CE for ; Tue, 16 Nov 2004 21:28:09 +0000 (GMT) Received: from mx.crye-leike.com (mx.crye-leike.com [208.62.148.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 097EF43D31 for ; Tue, 16 Nov 2004 21:28:09 +0000 (GMT) (envelope-from michaels@crye-leike.com) Received: from mail.crye-leike.com (local.mail [10.62.148.196]) by mx.crye-leike.com (8.12.11/8.12.11) with ESMTP id iAGLRw4Y008947; Tue, 16 Nov 2004 15:27:58 -0600 Received: from qh12008 (usr1.crye-leike.com [208.62.148.2]) by mail.crye-leike.com (8.12.11/8.12.11) with SMTP id iAGLS0Rn028195; Tue, 16 Nov 2004 15:28:00 -0600 From: "Michael Sims" To: Date: Tue, 16 Nov 2004 15:24:09 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Importance: Normal X-SA-Status: 2 X-Scanned-By: MIMEDefang 2.42 Subject: Possible bug in revision link generation in human readable diff mode X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2004 21:28:09 -0000 Hi, I apologize in advance if this has been brought up here before; I searched the list archives but couldn't find any reference to the problem I'm having. It looks like there may be a bug in the way CVSweb generates links to specific revisions when showing a human-readable, or colored diff (f=h). This problem appears in the latest cvsweb Debian package (3.0.2-1 in "testing") and also in the latest available from the CVSweb site (3.0.4). When viewing a colored diff between two revisions in "Show all branches" mode, the various links to specific revisions lack the question mark delimiter between the file path and the query string. For example, a link such as this may be generated: http://host/cgi-bin/cvsweb/module/file.php;rev=1.15 instead of: http://host/cgi-bin/cvsweb/module/file.php?;rev=1.15 or http://host/cgi-bin/cvsweb/module/file.php?rev=1.15 The two main revision links are generated this way, as well as any links that point to specific lines in various revisions. Clicking on these links return a "no such file or directory" error. When viewing a colored diff on a branch this problem does not occur, because in that case the link is structured like the following: http://host/cgi-bin/cvsweb/module/file.php?only_with_tag=TAG;rev=1.15 It seems that when the only_with_tag parameter is propagated the question mark is retained, which avoids the apparent bug. I haven't had a chance to get a real understanding of the code, but this simple patch seems to address the problem here: diff -u cvsweb.cgi.orig cvsweb.cgi --- cvsweb.cgi.orig 2004-11-16 14:55:48.000000000 -0600 +++ cvsweb.cgi 2004-11-16 14:56:44.000000000 -0600 @@ -3634,7 +3634,7 @@ $date1 = defined($date1) ? ', ' . htmlquote($date1) : ''; $date2 = defined($date2) ? ', ' . htmlquote($date2) : ''; - my $link = uri_escape($filename) . $query; + my $link = uri_escape($filename) . ($query ? $query : '?'); # Using Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 65C8716A4CE for ; Wed, 17 Nov 2004 21:03:23 +0000 (GMT) Received: from smtp1.pp.htv.fi (smtp1.pp.htv.fi [213.243.153.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 220E643D58 for ; Wed, 17 Nov 2004 21:03:23 +0000 (GMT) (envelope-from scop@FreeBSD.org) Received: from [62.78.134.122] (cs78134122.pp.htv.fi [62.78.134.122]) by smtp1.pp.htv.fi (Postfix) with ESMTP id 55BBA7FD0E for ; Wed, 17 Nov 2004 23:03:21 +0200 (EET) From: Ville =?ISO-8859-1?Q?Skytt=E4?= To: freebsd-cvsweb@freebsd.org In-Reply-To: References: Content-Type: text/plain Organization: FreeBSD Message-Id: <1100725400.21960.17.camel@bobcat.mine.nu> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 17 Nov 2004 23:03:21 +0200 Content-Transfer-Encoding: 7bit Subject: Re: Possible bug in revision link generation in human readable diff mode X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2004 21:03:23 -0000 On Tue, 2004-11-16 at 23:24, Michael Sims wrote: > It looks like there may be a bug in the way CVSweb generates links to specific > revisions when showing a human-readable, or colored diff (f=h). This problem > appears in the latest cvsweb Debian package (3.0.2-1 in "testing") and also in the > latest available from the CVSweb site (3.0.4). When viewing a colored diff between > two revisions in "Show all branches" mode, the various links to specific revisions > lack the question mark delimiter between the file path and the query string. For > example, a link such as this may be generated: > > http://host/cgi-bin/cvsweb/module/file.php;rev=1.15 Right. I was able to reproduce this by setting the default diff format to "h" in cvsweb.conf; couldn't reproduce if it was "u". Nevertheless, it's a bug, and your fix is correct. I'll commit a slightly modified one in a jiffy, it'll be included in the next cvsweb version. Thanks!