summaryrefslogtreecommitdiff
path: root/vidir
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 /vidir
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 'vidir')
-rwxr-xr-xvidir5
1 files changed, 4 insertions, 1 deletions
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});
}