From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id EF2861F462 for ; Mon, 10 Jun 2019 23:53:47 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] edit: fix portability of editor invocation Date: Mon, 10 Jun 2019 23:53:46 +0000 Message-Id: <20190610235346.64907-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The eval was unnecessary, and $0 can't be "--". Tested with /bin/sh on FreeBSD 11.2 --- script/public-inbox-edit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/public-inbox-edit b/script/public-inbox-edit index 16d7852..6a7d456 100755 --- a/script/public-inbox-edit +++ b/script/public-inbox-edit @@ -138,7 +138,7 @@ foreach my $to_edit (values %$found) { # 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"; } -- EW