From: Gilles Darold Date: Fri, 22 Feb 2019 09:28:29 +0000 (+0100) Subject: Fix broken wildcard use in ssh URI introduced in previous patch. Thanks to Tobias... X-Git-Tag: v11.0~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a45659e8b3cfb57e13aa3e85e45663d924c8a03;p=pgbadger Fix broken wildcard use in ssh URI introduced in previous patch. Thanks to Tobias Bussmann for the report. --- diff --git a/pgbadger b/pgbadger index 3d18939..e505164 100755 --- a/pgbadger +++ b/pgbadger @@ -2084,8 +2084,9 @@ sub set_file_list # Get files from remote host if ($file !~ /^ssh:/) { - &logmsg('DEBUG', "Looking for remote filename using command: $remote_command \"ls '$file'\""); - my @rfiles = `$remote_command "ls '$file'"`; + my($filename, $dirs, $suffix) = fileparse($file); + &logmsg('DEBUG', "Looking for remote filename using command: $remote_command \"ls '$dirs'$filename\""); + my @rfiles = `$remote_command "ls '$dirs'$filename"`; foreach my $f (@rfiles) { push(@lfiles, "$f$fmt"); @@ -2096,8 +2097,9 @@ sub set_file_list my $host_info = $1; my $file = $2; my $ssh = $ssh_command || 'ssh'; - &logmsg('DEBUG', "Looking for remote filename using command: $ssh $host_info \"ls '$file'\""); - my @rfiles = `$ssh $host_info "ls '$file'"`; + my($filename, $dirs, $suffix) = fileparse($file); + &logmsg('DEBUG', "Looking for remote filename using command: $ssh $host_info \"ls '$dirs'$filename\""); + my @rfiles = `$ssh $host_info "ls '$dirs'$filename"`; foreach my $f (@rfiles) { push(@lfiles, "ssh://$host_info/$f$fmt");