diff options
author | Eric Wong <e@80x24.org> | 2023-01-07 09:08:42 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-01-07 09:26:15 +0000 |
commit | 59dff045a1df2959ab159f926523b1f52ba3e3bf (patch) | |
tree | 38160f04e5ac62a9c93a13fcd2c6695334d949af | |
parent | f7da73e371bcb909a18e654918b5d1e7931e5652 (diff) | |
download | mwrap-59dff045a1df2959ab159f926523b1f52ba3e3bf.tar.gz |
The `_' stat cache is cleared if `-x' fails, so ensure we capture it cheaply from the preceding `-e' before attempting `-x "/usr/bin/debugperl"'.
-rw-r--r-- | lib/Devel/Mwrap/Rproxy.pm | 6 |
1 files 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; } |