aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/crontab.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/miscutils/crontab.c b/miscutils/crontab.c
index 76c382e8f..69f2e3123 100644
--- a/miscutils/crontab.c
+++ b/miscutils/crontab.c
@@ -296,7 +296,9 @@ static void EditFile(const char *user, const char *file)
if (ChangeUser(user, 1) < 0)
exit(0);
ptr = getenv("VISUAL");
- if (ptr == NULL || strlen(ptr) > 256)
+ if (ptr == NULL)
+ ptr = getenv("EDITOR");
+ if (ptr == NULL)
ptr = PATH_VI;
ptr = xasprintf("%s %s", ptr, file);