Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 May 2016 18:58:07 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299220 - head/usr.bin/sdiff
Message-ID:  <201605071858.u47Iw7eE010531@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Sat May  7 18:58:07 2016
New Revision: 299220
URL: https://svnweb.freebsd.org/changeset/base/299220

Log:
  Revert r299218 VISUAL is actually a perfecly valid env to specify an editor

Modified:
  head/usr.bin/sdiff/edit.c
  head/usr.bin/sdiff/sdiff.1

Modified: head/usr.bin/sdiff/edit.c
==============================================================================
--- head/usr.bin/sdiff/edit.c	Sat May  7 18:54:35 2016	(r299219)
+++ head/usr.bin/sdiff/edit.c	Sat May  7 18:58:07 2016	(r299220)
@@ -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);

Modified: head/usr.bin/sdiff/sdiff.1
==============================================================================
--- head/usr.bin/sdiff/sdiff.1	Sat May  7 18:54:35 2016	(r299219)
+++ head/usr.bin/sdiff/sdiff.1	Sat May  7 18:58:07 2016	(r299220)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605071858.u47Iw7eE010531>