summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul A. Patience <paul@apatience.com>2021-07-04 11:23:28 -0400
committerKaz Kylheku <kaz@kylheku.com>2021-07-04 11:34:07 -0700
commite713dede16407c021a5ec72f13147215cc78c3e8 (patch)
treedc70dabae6ac94b9cc26c8f1c35c94968f9943c9
parent1282c7c1aebaaca2005011397a576c22aa62db0b (diff)
downloadtxr-e713dede16407c021a5ec72f13147215cc78c3e8.tar.gz
txr-e713dede16407c021a5ec72f13147215cc78c3e8.tar.bz2
txr-e713dede16407c021a5ec72f13147215cc78c3e8.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.c2
-rw-r--r--txr.12
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