From 59dff045a1df2959ab159f926523b1f52ba3e3bf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 7 Jan 2023 09:08:42 +0000 Subject: rproxy: avoid uninitialized stat w/o debugperl The `_' stat cache is cleared if `-x' fails, so ensure we capture it cheaply from the preceding `-e' before attempting `-x "/usr/bin/debugperl"'. --- lib/Devel/Mwrap/Rproxy.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Devel/Mwrap/Rproxy.pm b/lib/Devel/Mwrap/Rproxy.pm index e2b7097..d5a9d9d 100644 --- a/lib/Devel/Mwrap/Rproxy.pm +++ b/lib/Devel/Mwrap/Rproxy.pm @@ -82,11 +82,13 @@ sub resolve_exe ($$) { $exe = ($l =~ /\A\#\![ \t]*(\S+)/) ? $1 : $^X; } return unless -e $exe; + my @st = stat(_); # Debian `perl-debug' is special: - ($exe eq '/usr/bin/perl' && -x '/usr/bin/debugperl') and + if ($exe eq '/usr/bin/perl' && -x '/usr/bin/debugperl') { + @st = stat(_); $exe = '/usr/bin/debugperl'; - my @st = stat(_); + } $$st = pack('dd', $st[10], $st[7]); # ctime + size $exe; } -- cgit v1.2.3-24-ge0c7