summaryrefslogtreecommitdiff
path: root/vipe
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 /vipe
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
Diffstat (limited to 'vipe')
-rwxr-xr-xvipe5
1 files changed, 4 insertions, 1 deletions
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});
}