summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFelipe Gasper <felipe@felipegasper.com>2022-05-03 22:04:11 -0400
committerTodd Rinaldo <toddr@cpan.org>2022-05-13 13:23:18 -0500
commit4cae439d7c35dd26cd7d2ece749d8999ce499807 (patch)
treee70a31cb5364dea701f120d0a09cd62079ef16c4 /t
parenta5aac01fc121e3b14a69dd62d13e60ad49b54115 (diff)
downloadperl-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.t6
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;
};