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
--- a/crontab.c
+++ b/crontab.c
@@ -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;
 	}
