diff options
author | Paul A. Patience <paul@apatience.com> | 2021-07-04 11:23:28 -0400 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-07-04 11:34:07 -0700 |
commit | 15570ad0322f15b22af1ec661f1c2630cad9ea72 (patch) | |
tree | dc70dabae6ac94b9cc26c8f1c35c94968f9943c9 | |
parent | dd3e302830fe613800a62a7d2c05e2fad7afd7ce (diff) | |
download | txr-15570ad0322f15b22af1ec661f1c2630cad9ea72.tar.gz txr-15570ad0322f15b22af1ec661f1c2630cad9ea72.tar.bz2 txr-15570ad0322f15b22af1ec661f1c2630cad9ea72.zip |
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.
-rw-r--r-- | linenoise/linenoise.c | 2 | ||||
-rw-r--r-- | 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 @@ -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 |