Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/Rex/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,11 @@ sub read_config_file {
$config_file ||= _home_dir() . "/.rex/config.yml";

if ( -f $config_file ) {
my $yaml = eval { local ( @ARGV, $/ ) = ($config_file); <>; };
my $yaml = do {
use IO::File;
my $fh = IO::File->new( $config_file, 'r' );
join '', $fh->getlines();
};
eval { $HOME_CONFIG_YAML = Load($yaml); };

if ($@) {
Expand All @@ -1762,7 +1766,11 @@ sub read_ssh_config_file {
$config_file ||= _home_dir() . '/.ssh/config';

if ( -f $config_file ) {
my @lines = eval { local (@ARGV) = ($config_file); <>; };
my @lines = do {
use IO::File;
my $fh = IO::File->new( $config_file, 'r' );
join '', $fh->getlines();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be that t/config-ssh.t fails because now all lines of the file is concatenated with join while it was treated as an array of lines before?

};
%SSH_CONFIG_FOR = _parse_ssh_config(@lines);
}
}
Expand Down