From: short <> Date: Sun, 6 Jun 2004 19:54:34 +0000 (+0000) Subject: a_href "size"=>2 forces the size indicator even for properly non-suffixed files. X-Git-Tag: bp_apache2~1 X-Git-Url: http://git.jankratochvil.net/?p=MyWeb.git;a=commitdiff_plain;h=23bbfdb08c25726bc9687423c10dd28b08753436 a_href "size"=>2 forces the size indicator even for properly non-suffixed files. --- diff --git a/Project.pm b/Project.pm index 2088d99..ab40eb7 100644 --- a/Project.pm +++ b/Project.pm @@ -86,7 +86,7 @@ my($class,$ListItem,%args)=@_; 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-//; diff --git a/Web.pm b/Web.pm index d349658..ea6f32f 100644 --- a/Web.pm +++ b/Web.pm @@ -411,7 +411,7 @@ my($url,$contents,%args)=@_; $r.='"'; do { $r.=" $_" if $_; } for ($args{"attr"}); $r.='>'.$contents.''; - 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"; }