per suggestion of jl, test for bad chars before starting processing
authorgc <gc>
Tue, 29 Nov 2005 21:35:21 +0000 (21:35 +0000)
committergc <gc>
Tue, 29 Nov 2005 21:35:21 +0000 (21:35 +0000)
bin/booh-backend

index 4c88919e53bb9420b17e88fd3dfee7274ac977a6..db2d72fc9e1a8ab813927226b09c96cd4282dca6 100755 (executable)
@@ -609,16 +609,25 @@ def walk_source_dir
     end
     info("directories: #{examined_dirs.length}, sizes: #{$images_size.length}")
 
+    examined_dirs.each { |dir|
+        if dir =~ /'/
+            die _("Source directory or sub-directories can't contain a single-quote character, sorry: %s") % dir
+        end
+        if $mode !~ /^use_config/
+            Dir.entries(dir).each { |file|
+                if file =~ /['"\[\]]/
+                    die _("Files can't contain any of the characters ', \", [ or ], sorry: %s") % "#{dir}/#{file}"
+                end
+            }
+        end
+    }
+
     examined_dirs.each { |dir|
         if File.basename(dir) =~ /^\./
             msg 1, _("Ignoring directory %s, begins with a dot (indicating a hidden directory)") % dir
             next
         end
 
-        if dir =~ /'/
-            die _("Source directory or sub-directories can't contain a single-quote character, sorry: %s") % dir
-        end
-
         dest_dir = make_dest_filename(dir.sub(/^#{Regexp.quote($source)}/, $dest))
 
         #- place xml document on proper node if exists, else create