a_href "size"=>2 forces the size indicator even for properly non-suffixed files.
authorshort <>
Sun, 6 Jun 2004 19:54:34 +0000 (19:54 +0000)
committershort <>
Sun, 6 Jun 2004 19:54:34 +0000 (19:54 +0000)
Project.pm
Web.pm

index 2088d99..ab40eb7 100644 (file)
@@ -86,7 +86,7 @@ my($class,$ListItem,%args)=@_;
                                                return "Download".$_[0];
                                                },
                                "format"=>sub ($) {
                                                return "Download".$_[0];
                                                },
                                "format"=>sub ($) {
-                                               return a_href($_[0],CGI::escapeHTML(File::Basename::basename($_[0])));
+                                               return a_href($_[0],CGI::escapeHTML(File::Basename::basename($_[0])),"size"=>2);
                                                }},
                {"key"=>qr(^link\b),"text"=>sub ($) {
                                                $_[0]=~s/^link-//;
                                                }},
                {"key"=>qr(^link\b),"text"=>sub ($) {
                                                $_[0]=~s/^link-//;
diff --git a/Web.pm b/Web.pm
index d349658..ea6f32f 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -411,7 +411,7 @@ my($url,$contents,%args)=@_;
        $r.='"';
        do { $r.=" $_" if $_; } for ($args{"attr"});
        $r.='>'.$contents.'</a>';
        $r.='"';
        do { $r.=" $_" if $_; } for ($args{"attr"});
        $r.='>'.$contents.'</a>';
-       if ($args{"size"} && url_is_local($url) && $url=~/[.](?:gz|Z|rpm|zip|deb|lha)/) {       # Downloadable?
+       if ($args{"size"} && url_is_local($url) && ($args{"size"}>=2 || $url=~/[.](?:gz|Z|rpm|zip|deb|lha)/)) { # Downloadable?
                $url=top_dir_disk().$url if $url=~m#^/#;
                if (!-r $url)
                        { cluck "File not readable: $url"; }
                $url=top_dir_disk().$url if $url=~m#^/#;
                if (!-r $url)
                        { cluck "File not readable: $url"; }