diff options
author | Felipe Gasper <felipe@felipegasper.com> | 2022-05-03 22:04:11 -0400 |
---|---|---|
committer | Todd Rinaldo <toddr@cpan.org> | 2022-05-13 13:23:18 -0500 |
commit | 4cae439d7c35dd26cd7d2ece749d8999ce499807 (patch) | |
tree | e70a31cb5364dea701f120d0a09cd62079ef16c4 /t | |
parent | a5aac01fc121e3b14a69dd62d13e60ad49b54115 (diff) | |
download | perl-4cae439d7c35dd26cd7d2ece749d8999ce499807.tar.gz |
Make t/op/magic.t pass on AlmaLinux 8’s kernel.
Issue #19690
Diffstat (limited to 't')
-rw-r--r-- | t/op/magic.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/op/magic.t b/t/op/magic.t index d879406f58..9af1cef44c 100644 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -469,7 +469,11 @@ EOP open my $rfh, '<', "/proc/$$/cmdline" or skip "failed to read '/proc/$$/cmdline': $!", $skip; my $got = do { local $/; <$rfh> }; - $got=~s/\0\z//; + + # Some kernels leave a trailing NUL on. Some add a bunch of spaces + # after that NUL. We want neither. + $got=~s/\0\s*\z//; + return $got; }; |