migration from private to rsa
[external/bash.git] / debian / patches / bash-default-editor.dpatch
1 #! /bin/sh -e
2
3 if [ $# -eq 3 -a "$2" = '-d' ]; then
4     pdir="-d $3"
5 elif [ $# -ne 1 ]; then
6     echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
7     exit 1
8 fi
9 case "$1" in
10     -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
11     -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
12     *)
13         echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
14         exit 1
15 esac
16 exit 0
17
18 # DP: Use `command -v editor`, as an editor, if available.
19
20 --- bash/builtins/fc.def~       2005-10-13 18:11:24.798452832 +0200
21 +++ bash/builtins/fc.def        2005-10-13 19:36:11.956087320 +0200
22 @@ -156,11 +156,11 @@
23  #endif
24  
25  /* String to execute on a file that we want to edit. */
26 -#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-vi}}"
27 +#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo vi)}}"
28  #if defined (STRICT_POSIX)
29  #  define POSIX_FC_EDIT_COMMAND "${FCEDIT:-ed}"
30  #else
31 -#  define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-ed}}"
32 +#  define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo ed)}}"
33  #endif
34  
35  int
36 --- bash/bashline.c~    2005-10-13 18:11:24.827448424 +0200
37 +++ bash/bashline.c     2005-10-13 19:37:35.382404592 +0200
38 @@ -800,8 +800,8 @@
39     command being entered (if no explicit argument is given), otherwise on
40     a command from the history file. */
41  
42 -#define VI_EDIT_COMMAND                "fc -e \"${VISUAL:-${EDITOR:-vi}}\""
43 -#define EMACS_EDIT_COMMAND     "fc -e \"${VISUAL:-${EDITOR:-emacs}}\""
44 +#define VI_EDIT_COMMAND                "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo vi)}}\""
45 +#define EMACS_EDIT_COMMAND     "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo emacs)}}\""
46  #define POSIX_VI_EDIT_COMMAND  "fc -e vi"
47  
48  static int