sub show_cmd ($$) {
my ($ibx, $smsg) = @_;
- " GIT_DIR=$ibx->{mainrepo}/all.git \\\n git show $smsg->{blob}\n";
+ " GIT_DIR=$ibx->{inboxdir}/all.git \\\n git show $smsg->{blob}\n";
}
sub show_found () {
my $tmpl = 'public-inbox-edit-XXXXXX';
foreach my $to_edit (values %$found) {
- my ($edit_fh, $edit_fn) = tempfile($tmpl, TMPDIR => 1);
+ my ($edit_fh, $edit_fn) = tempfile($tmpl, TMPDIR => 1, UNLINK => 1);
$edit_fh->autoflush(1);
my ($ibx, $smsg) = @{$to_edit->[0]};
my $old_raw = $ibx->msg_by_smsg($smsg);
# run the editor, respecting spaces/quote
retry_edit:
- if (system(qw(sh -c), qq(eval "$editor" '"\$@"'), '--', $edit_fn)) {
+ if (system(qw(sh -c), $editor.' "$@"', $editor, $edit_fn)) {
if (!(-t STDIN) && !$opt->{force}) {
die "E: $editor failed: $?\n";
}