diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-03-26 06:22:13 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-03-26 06:22:13 +0000 |
commit | 1f0e0c9da0e8474c444549a2394b3bcf87306906 (patch) | |
tree | 4832152205a41ea23cb686820b0f4a75dd0939be /usr.bin/sendbug/sendbug.c | |
parent | bb54122a84470fcdf543564b5e481db65c66bec4 (diff) |
Accept $VISUAL in addition to $EDITOR.
Diffstat (limited to 'usr.bin/sendbug/sendbug.c')
-rw-r--r-- | usr.bin/sendbug/sendbug.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c index 2227cb83150..b83e66c6db6 100644 --- a/usr.bin/sendbug/sendbug.c +++ b/usr.bin/sendbug/sendbug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendbug.c,v 1.25 2007/03/26 05:50:18 ray Exp $ */ +/* $OpenBSD: sendbug.c,v 1.26 2007/03/26 06:22:12 ray Exp $ */ /* * Written by Ray Lai <ray@cyth.net>. @@ -170,7 +170,10 @@ editit(char *tmpfile) pid_t pid, xpid; int st; - if ((ed = getenv("EDITOR")) == (char *)0) + ed = getenv("VISUAL"); + if (ed == NULL || ed[0] == '\0') + ed = getenv("EDITOR"); + if (ed == NULL || ed[0] == '\0') ed = _PATH_VI; if (asprintf(&p, "%s %s", ed, tmpfile) == -1) return (-1); |