summaryrefslogtreecommitdiffstats
path: root/debian/patches/bash-default-editor.diff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 06:17:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 06:17:26 +0000
commit3abb3f4db4372683dde9d2565d27d807ffdd5ac4 (patch)
tree83da6f31e160b887fcf21342ac42b2ea21a457c0 /debian/patches/bash-default-editor.diff
parentAdding upstream version 5.1. (diff)
downloadbash-94b38b7231a9016c77f0f5d3ac83d4510f9086cb.tar.xz
bash-94b38b7231a9016c77f0f5d3ac83d4510f9086cb.zip
Adding debian version 5.1-2+deb11u1.debian/5.1-2+deb11u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/bash-default-editor.diff')
-rw-r--r--debian/patches/bash-default-editor.diff31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/patches/bash-default-editor.diff b/debian/patches/bash-default-editor.diff
new file mode 100644
index 0000000..d76ef89
--- /dev/null
+++ b/debian/patches/bash-default-editor.diff
@@ -0,0 +1,31 @@
+# DP: Use `command -v editor`, as an editor, if available.
+
+--- a/bashline.c
++++ b/bashline.c
+@@ -921,8 +921,8 @@ hostnames_matching (text)
+ command being entered (if no explicit argument is given), otherwise on
+ a command from the history file. */
+
+-#define VI_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-vi}}\""
+-#define EMACS_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-emacs}}\""
++#define VI_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo vi)}}\""
++#define EMACS_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo emacs)}}\""
+ #define POSIX_VI_EDIT_COMMAND "fc -e vi"
+
+ static int
+--- a/builtins/fc.def
++++ b/builtins/fc.def
+@@ -171,11 +171,11 @@ set_verbose_flag ()
+ }
+
+ /* String to execute on a file that we want to edit. */
+-#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-vi}}"
++#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo vi)}}"
+ #if defined (STRICT_POSIX)
+ # define POSIX_FC_EDIT_COMMAND "${FCEDIT:-ed}"
+ #else
+-# define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-ed}}"
++# define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo ed)}}"
+ #endif
+
+ int