diff options
author | Eric Wong <e@80x24.org> | 2021-05-01 06:21:17 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-05-01 23:12:41 +0000 |
commit | 6dbc443f8acfb262ca1ab263b60ecb801c00aac2 (patch) | |
tree | 385920c43311bae5ba2d4085a1c37a037e353084 /script | |
parent | 0d00fb2ee87d714ede9f8937dde9bae8d778804d (diff) | |
download | public-inbox-6dbc443f8acfb262ca1ab263b60ecb801c00aac2.tar.gz |
The contents of the old lei.q.output will not be removed, but will be converted into the new one.
Diffstat (limited to 'script')
-rwxr-xr-x | script/lei | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -33,8 +33,15 @@ my $exec_cmd = sub { push @rdr, shift(@old), $newfh; } my $do_exec = sub { + my @non_std; # ex. $op_p from lei_edit_search while (my ($io, $newfh) = splice(@rdr, 0, 2)) { + my $old_io = !!$io; open $io, '+<&', $newfh or die "open +<&=: $!"; + push @non_std, $io unless $old_io; + } + if (@non_std) { + require Fcntl; + fcntl($_, Fcntl::F_SETFD(), 0) for @non_std; } my %env = map { split(/=/, $_, 2) } splice(@argv, $argc); @ENV{keys %env} = values %env; |