r910 - html/trunk/scripts

lizardo at linuxfromscratch.org lizardo at linuxfromscratch.org
Sun Dec 12 09:39:18 PST 2004


Author: lizardo
Date: 2004-12-12 10:39:16 -0700 (Sun, 12 Dec 2004)
New Revision: 910

Modified:
   html/trunk/scripts/manage_news.pl
Log:
Fixed manage_news.pl warning when number of news items < $show_content + $show_link.


Modified: html/trunk/scripts/manage_news.pl
===================================================================
--- html/trunk/scripts/manage_news.pl	2004-12-12 02:33:47 UTC (rev 909)
+++ html/trunk/scripts/manage_news.pl	2004-12-12 17:39:16 UTC (rev 910)
@@ -17,8 +17,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: manage_news.pl,v 1.29 2004/07/11 04:43:57 lizardo Exp $
-
 use strict;
 use warnings;
 
@@ -194,7 +192,10 @@
     foreach my $part (splice(@{[$mime_entity->parts]}, 0, $show_content)) {
         print mime2html($part);
     }
-    my @show_as_links = splice(@{[$mime_entity->parts]}, $show_content, $show_link);
+	my @show_as_links = ();
+	if (@{[$mime_entity->parts]} >= $show_content + $show_link) {
+		@show_as_links = splice(@{[$mime_entity->parts]}, $show_content, $show_link);
+	}
     if (@show_as_links) {
         print "<div class=\"oldnews\">\n\t<h3>Previous news:</h3>\n\t<ul>\n";
         foreach my $part (@show_as_links) {




More information about the website mailing list