summaryrefslogtreecommitdiffstats
path: root/usr.bin/sdiff
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2016-05-07 18:58:07 +0000
committerbapt <bapt@FreeBSD.org>2016-05-07 18:58:07 +0000
commit3e534bbcb82f30d2f77092aa6f28f1ca1ff54fa1 (patch)
tree3a5cfbf6696d3781b444ef4a2a3eb41f03221f35 /usr.bin/sdiff
parentdf74ac413bf394ee0a163888b748bac3906b4fce (diff)
downloadFreeBSD-src-3e534bbcb82f30d2f77092aa6f28f1ca1ff54fa1.zip
FreeBSD-src-3e534bbcb82f30d2f77092aa6f28f1ca1ff54fa1.tar.gz
Revert r299218 VISUAL is actually a perfecly valid env to specify an editor
Diffstat (limited to 'usr.bin/sdiff')
-rw-r--r--usr.bin/sdiff/edit.c5
-rw-r--r--usr.bin/sdiff/sdiff.118
2 files changed, 20 insertions, 3 deletions
diff --git a/usr.bin/sdiff/edit.c b/usr.bin/sdiff/edit.c
index 16345da..21f7cdc 100644
--- a/usr.bin/sdiff/edit.c
+++ b/usr.bin/sdiff/edit.c
@@ -40,7 +40,10 @@ editit(const char *pathname)
int saved_errno, st, ret = -1;
const char *ed;
- if ((ed = getenv("EDITOR")) == NULL)
+ ed = getenv("VISUAL");
+ if (ed == NULL)
+ ed = getenv("EDITOR");
+ if (ed == NULL)
ed = _PATH_VI;
sighup = signal(SIGHUP, SIG_IGN);
diff --git a/usr.bin/sdiff/sdiff.1 b/usr.bin/sdiff/sdiff.1
index 11e605d..16e340a 100644
--- a/usr.bin/sdiff/sdiff.1
+++ b/usr.bin/sdiff/sdiff.1
@@ -4,7 +4,7 @@
.\" Written by Raymond Lai <ray@cyth.net>.
.\" Public domain.
.\"
-.Dd May 7, 2016
+.Dd $Mdocdate: July 5 2012 $
.Dt SDIFF 1
.Os
.Sh NAME
@@ -50,6 +50,8 @@ into
In this mode, the user is prompted for each set of differences.
See
.Ev EDITOR
+and
+.Ev VISUAL ,
below,
for details of which editor, if any, is invoked.
.Pp
@@ -131,10 +133,22 @@ Change the size of tabs (default is 8.)
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
-.It Ev EDITOR
+.It Ev EDITOR , VISUAL
Specifies an editor to use with the
.Fl o
option.
+If both
+.Ev EDITOR
+and
+.Ev VISUAL
+are set,
+.Ev VISUAL
+takes precedence.
+If neither
+.Ev EDITOR
+nor
+.Ev VISUAL
+are set,
the default is
.Xr vi 1 .
.It Ev TMPDIR
OpenPOWER on IntegriCloud