From 27b3661b56bce01f475d84f917ddb8250ce6c505 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Tue, 30 Jul 2024 23:06:19 +0800 Subject: [PATCH] paste: out-of-order check * As with PR675, check for '-' argument needs to occur first * The argument '-' doesn't have a special meaning for all commands --- bin/paste | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/paste b/bin/paste index 5005f6b4..52deea38 100755 --- a/bin/paste +++ b/bin/paste @@ -39,13 +39,13 @@ if (defined $opt{'d'}) { } foreach my $f (@ARGV) { - if (-d $f) { - warn "$Program: '$f': is a directory\n"; - exit EX_FAILURE; - } if ($f eq '-') { push @fh, *STDIN; } else { + if (-d $f) { + warn "$Program: '$f': is a directory\n"; + exit EX_FAILURE; + } my $fil; unless (open $fil, '<', $f) { warn "$Program: '$f': $!\n";