remove traling spaces from non empty lines in command output
[spider.git] / perl / DXCommandmode.pm
index fe5a484295f7bc9c0a9948946dfa362559e11506..42b2efbb8ca93ea2234a32618a3afefd2d8e4343 100644 (file)
@@ -47,7 +47,7 @@ $maxbadcount = 3;                             # no of bad words allowed before disconnection
 
 use vars qw($VERSION $BRANCH);
 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0;
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
 $main::build += $VERSION;
 $main::branch += $BRANCH;
 
@@ -470,7 +470,7 @@ sub run_cmd
                        return ();
                }
        }
-       return (@ans);
+       return map {s/[^\s]\s+$//; $_} @ans;
 }
 
 #