]> Sergey Matveev's repositories - public-inbox.git/commit
lei completion: workaround old Perl bug
authorEric Wong <e@80x24.org>
Mon, 27 Sep 2021 21:05:45 +0000 (16:05 -0500)
committerEric Wong <e@80x24.org>
Mon, 27 Sep 2021 21:08:35 +0000 (21:08 +0000)
commit010159a7b789a3a27c917a5378db92c8adf78a9e
tree002f8a98c656ed2395a446206e14b05506e8b5d6
parent81a0962fa9798c4fb0ab234ed54f3e886996a8a0
lei completion: workaround old Perl bug

While `$argv[-1]' is `undef' on an empty @argv, using `$argv[-1]'
as a subroutine argument would fail incorrectly with:

    Modification of non-creatable array value attempted, subscript -1 at ...

...even though we'd never attempt to modify @_ itself in the
subroutines being called.  Work around the bug (tested on
5.16.3) by passing `undef' explicitly when `$argv[-1]' is
already `undef'.

Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Link: https://public-inbox.org/meta/20210927124056.kj5okiefvs4ztk27@meerkat.local/
lib/PublicInbox/LeiExportKw.pm
lib/PublicInbox/LeiImport.pm
lib/PublicInbox/LeiLsMailSource.pm
lib/PublicInbox/LeiRefreshMailSync.pm