changed `fileref' to do URL quoting, so that (for example)

http://cvs-mirror.mozilla.org/webtools/lxr/source/build/mac/client.mac/
links "Client.Mac READ ME" to
".../client.mac/Client.Mac%20READ%20ME" instead of
".../client.mac/Client.Mac READ ME"
This commit is contained in:
jwz%mozilla.org 1999-01-31 10:52:32 +00:00
parent 9952b537d3
commit f3dc1dfade

View File

@ -1,4 +1,4 @@
# $Id: Common.pm,v 1.13 1999/01/21 00:42:26 endico%mozilla.org Exp $
# $Id: Common.pm,v 1.14 1999/01/31 10:52:32 jwz%mozilla.org Exp $
package LXR::Common;
@ -83,6 +83,10 @@ sub urlargs {
sub fileref {
my ($desc, $path, $line, @args) = @_;
# jwz: URL-quote any special characters.
$path =~ s|([^-a-zA-Z0-9.\@/_\r\n])|sprintf("%%%02X", ord($1))|ge;
return("<a href=\"$Conf->{virtroot}/source$path".
&urlargs(@args).
($line > 0 ? "#$line" : "").