summaryrefslogtreecommitdiffstats
path: root/usr.bin/sendbug/sendbug.c
diff options
context:
space:
mode:
authorray <ray@openbsd.org>2007-03-26 06:22:12 +0000
committerray <ray@openbsd.org>2007-03-26 06:22:12 +0000
commitc8a426ad09be751d07dfe2930b6f58b9e6a09e78 (patch)
tree5eb214e2d43831d6c80b2ad904771aeff3636131 /usr.bin/sendbug/sendbug.c
parentSave and restore signal handlers. Although we do not install our (diff)
downloadwireguard-openbsd-c8a426ad09be751d07dfe2930b6f58b9e6a09e78.tar.xz
wireguard-openbsd-c8a426ad09be751d07dfe2930b6f58b9e6a09e78.zip
Accept $VISUAL in addition to $EDITOR.
Diffstat (limited to 'usr.bin/sendbug/sendbug.c')
-rw-r--r--usr.bin/sendbug/sendbug.c7
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);