add spot2sql.pl for experiment sql support
[spider.git] / perl / DXCommandmode.pm
index 95039af60ef5ef477ddc77333660a246610c830a..080cf666ce0cbc3dc99032bbc4a1d9452af24bd1 100644 (file)
@@ -437,8 +437,10 @@ sub run_cmd
        $args = "" unless defined $args;
                
        if ($cmd) {
-               # strip out // on command only
+               # strip out // and .. on command only
                $cmd =~ s|//|/|g;
+               $cmd =~ s|^/||g;                # no leading / either
+               $cmd =~ s|[^-?\w/]||g;  # and no funny characters
                                        
                my ($path, $fcmd);
                        
@@ -454,7 +456,7 @@ sub run_cmd
                        
                # first expand out the entry to a command
                ($path, $fcmd) = search($main::localcmd, $cmd, "pl");
-               ($path, $fcmd) = search($main::cmd, $cmd, "pl") if !$path || !$fcmd;
+               ($path, $fcmd) = search($main::cmd, $cmd, "pl") unless $path && $fcmd;
 
                if ($path && $cmd) {
                        dbg("path: $cmd cmd: $fcmd") if isdbg('command');