tasty changes for building custom scripts
[feisty_meow.git] / scripts / files / filename_helper.pl
index 86de1dab12d1c30d157f1b3419bab9e50d943859..b4218166bdace61371b05ba1ca7c56fcc3e0fcb3 100644 (file)
@@ -444,11 +444,16 @@ sub find_directories {
 
 ############################################################################
 
-# given a directory, this returns an array of all the filenames found therein.
+# given a list of paths, this returns an array of all the filenames found therein.
 sub find_files {
   my @files_found = ();
   my $dir;
   foreach $dir (@_) {
+    if (-f $dir) {
+      # that's actually just a file, so add it.
+      push @files_found, $dir;
+      next;
+    }
     local *DIR;
     opendir DIR, $dir or die "opendir $dir: $!";
     while ($_ = readdir DIR) {