From cd9390bfd5c25ce692cb0062ae191f15e39329d0 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:30:12 +0800 Subject: [PATCH] unshar: '--' option terminator (#481) * I noticed that shar works with command line "perl shar -- -file1", but unshar doesn't * There was no unshar command on my Linux or OpenBSD system to test against * I installed gnu sharutils 4.15.2 and proved that it does support '--' /usr/bin/unshar -- -file1 fs error 2 (No such file or directory) stat-ing -file1 --- bin/unshar | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/unshar b/bin/unshar index 739efb99..f1823ae6 100755 --- a/bin/unshar +++ b/bin/unshar @@ -20,6 +20,7 @@ License: perl while (@ARGV && $ARGV[0] =~ s/^-//) { local $_ = shift; + last if $_ eq '-'; # '--' terminator while (/([cdfq])/g) { if ($1 eq 'd') { $opts{'d'} = /\G(.*)/g && $1 ? $1 : shift;