summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoeyh <joeyh>2006-07-26 02:46:50 +0000
committerjoeyh <joeyh>2006-07-26 02:46:50 +0000
commit92f6884638abdda0fd8140379fcfc2ed36c37679 (patch)
tree6a152ba8180f345c32676ff1a806a8af35b7cfc4
parent11a51513fff47e8756ecdc1f24703b540c309eb5 (diff)
downloadmoreutils-92f6884638abdda0fd8140379fcfc2ed36c37679.tar.gz
* vidir, vipe: Use /usr/bin/editor if it's present, and EDITOR and VISUAL
arn't set, to comply with Debian policy. For portability, fall back to vi if there's no /usr/bin/editor. Closes: #378623
-rw-r--r--debian/changelog3
-rwxr-xr-xvidir5
-rwxr-xr-xvipe5
3 files changed, 11 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index db55dc9..2e639a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,9 @@ moreutils (0.15) UNRELEASED; urgency=low
a file. Changed behavior to just print all lines from both files, even
if this means printing dups. Not sure I like this behavior either, but
it's consistent with the very useful behaviors of "and" and "not".
+ * vidir, vipe: Use /usr/bin/editor if it's present, and EDITOR and VISUAL
+ arn't set, to comply with Debian policy. For portability, fall back to vi
+ if there's no /usr/bin/editor. Closes: #378623
-- Joey Hess <joeyh@debian.org> Tue, 25 Jul 2006 22:26:56 -0400
diff --git a/vidir b/vidir
index f8227b1..f67f74d 100755
--- a/vidir
+++ b/vidir
@@ -39,7 +39,7 @@ Verbosely display the actions taken by the program.
=item EDITOR
-Editor to use. Defaults to vi if not set.
+Editor to use.
=item VISUAL
@@ -104,6 +104,9 @@ foreach (@dir) {
close OUT;
my @editor="vi";
+if (-x "/usr/bin/editor") {
+ @editor="/usr/bin/editor";
+}
if (exists $ENV{EDITOR}) {
@editor=split(' ', $ENV{EDITOR});
}
diff --git a/vipe b/vipe
index 773eacf..8cee2b1 100755
--- a/vipe
+++ b/vipe
@@ -19,7 +19,7 @@ edit the data that is being piped between programs.
=item EDITOR
-Editor to use. Defaults to vi if not set.
+Editor to use.
=item VISUAL
@@ -52,6 +52,9 @@ close STDOUT;
open(STDOUT, ">/dev/tty") || die "reopen stdout: $!";
my @editor="vi";
+if (-x "/usr/bin/editor") {
+ @editor="/usr/bin/editor";
+}
if (exists $ENV{EDITOR}) {
@editor=split(' ', $ENV{EDITOR});
}