From 15570ad0322f15b22af1ec661f1c2630cad9ea72 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Sun, 4 Jul 2021 11:23:28 -0400 Subject: listener: treat unset and empty EDITOR the same. * linenoise/linenoise.c (edit_in_editor): Treat empty EDITOR variable as if it were unset (i.e., do nothing). * txr.1: Documented. --- linenoise/linenoise.c | 2 +- txr.1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index c82e0ca2..99af2418 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -1940,7 +1940,7 @@ static void edit_in_editor(lino_t *l) { char *ed = getenv("EDITOR"); char path[128]; - if (ed) { + if (ed && ed[0] != '\0') { const char *ho = get_home(); int fd; #if HAVE_MKSTEMPS diff --git a/txr.1 b/txr.1 index 72e38c48..11275867 100644 --- a/txr.1 +++ b/txr.1 @@ -81621,7 +81621,7 @@ terminates, the file is read into the editing buffer. The editor is determined from the .code EDITOR -environment variable. If this variable doesn't exist, +environment variable. If this variable is unset or empty, the command does nothing. The temporary file is created in the home directory, if that can -- cgit v1.2.3