[LON-CAPA-cvs] cvs: loncom /debugging_tools modify_config_files.pl

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 10 Aug 2004 20:26:02 -0000


matthew		Tue Aug 10 16:26:02 2004 EDT

  Modified files:              
    /loncom/debugging_tools	modify_config_files.pl 
  Log:
  Fix bug where new sections would cause death.
  
  
Index: loncom/debugging_tools/modify_config_files.pl
diff -u loncom/debugging_tools/modify_config_files.pl:1.1 loncom/debugging_tools/modify_config_files.pl:1.2
--- loncom/debugging_tools/modify_config_files.pl:1.1	Mon Aug  9 17:05:40 2004
+++ loncom/debugging_tools/modify_config_files.pl	Tue Aug 10 16:26:02 2004
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network
 #
-# $Id: modify_config_files.pl,v 1.1 2004/08/09 21:05:40 matthew Exp $
+# $Id: modify_config_files.pl,v 1.2 2004/08/10 20:26:02 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -259,7 +259,7 @@
             unshift(@$target,$newline);
         } else {
             # No need to put things after a blank line.
-            if ($target->[-1] =~ /^\s*$/) {
+            if (defined($target->[-1]) && $target->[-1] =~ /^\s*$/) {
                 $target->[-1] = $newline;
             } else {
                 push(@$target,$newline);