1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
From: Christian Kastner <ckk@kvr.at>
Date: Tue, 22 Dec 2015 23:08:18 +0100
Subject: Tolerate empty EDITOR and VISUAL envvars
Treat empty EDITOR and VISUAL environment variables as if they were unset.
Fix provided by Steve Greenland <stevegr@debian.org>.
Bug-Debian: https://bugs.debian.org/148809
Forwarded: no
Last-Update: 2015-12-22
crontab.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/crontab.c b/crontab.c
index a43d9ce..c71bc38 100644
@@ -394,8 +394,8 @@ edit_cmd() {
}
mtime = statbuf.st_mtime;
- if ((!(editor = getenv("VISUAL")))
- && (!(editor = getenv("EDITOR")))
+ if ((!((editor = getenv("VISUAL")) && strlen(editor)))
+ && (!((editor = getenv("EDITOR")) && strlen(editor)))
) {
editor = EDITOR;
}
|