Handle directory name with a space
authorJamie Cameron <jcameron@webmin.com>
Thu, 11 Nov 2010 00:45:25 +0000 (16:45 -0800)
committerJamie Cameron <jcameron@webmin.com>
Thu, 11 Nov 2010 00:45:25 +0000 (16:45 -0800)
updown/fetch.cgi

index bfa00c1..2f1b576 100755 (executable)
@@ -40,8 +40,10 @@ if ($ENV{'PATH_INFO'}) {
        if (-d $file) {
                # Zip up the whole directory
                ($shortfile = $file) =~ s/^.*\///g;
+               $shortfile =~ s/\s+//g;
                $temp = &transname($shortfile.".zip");
-               $out = &backquote_command("cd ".quotemeta($file)." && zip -r $temp .");
+               $out = &backquote_command("cd ".quotemeta($file).
+                                         " && zip -r ".quotemeta($temp)." .");
                if ($?) {
                        &error(&text('fetch_ezipcmd',
                                     "<tt>".&html_escape($out)."</tt>"));