diff --git a/bin/stow.in b/bin/stow.in index 1ebc695..ec83f59 100755 --- a/bin/stow.in +++ b/bin/stow.in @@ -537,11 +537,7 @@ sub process_options { sub sanitize_path_options { my ($options) = @_; - if (exists $options->{dir}) { - $options->{dir} =~ s/\A +//; - $options->{dir} =~ s/ +\z//; - } - else { + unless (exists $options->{dir}) { $options->{dir} = length $ENV{STOW_DIR} ? $ENV{STOW_DIR} : getcwd(); } @@ -549,8 +545,6 @@ sub sanitize_path_options { unless -d $options->{dir}; if (exists $options->{target}) { - $options->{target} =~ s/\A +//; - $options->{target} =~ s/ +\z//; usage("--target value '$options->{target}' is not a valid directory") unless -d $options->{target}; } diff --git a/t/cli_options.t b/t/cli_options.t index 809cf15..fafb6d8 100755 --- a/t/cli_options.t +++ b/t/cli_options.t @@ -17,8 +17,8 @@ init_test_dirs(); local @ARGV = ( '-v', - "-d $OUT_DIR/stow", - "-t $OUT_DIR/target", + '-d', "$OUT_DIR/stow", + '-t', "$OUT_DIR/target", 'dummy' );