Upload Tizen:Base source
[external/bash.git] / packaging / bash-default-editor.patch
1 # DP: Use `command -v editor`, as an editor, if available.
2
3 --- bash/builtins/fc.def~       2005-10-13 18:11:24.798452832 +0200
4 +++ bash/builtins/fc.def        2005-10-13 19:36:11.956087320 +0200
5 @@ -156,11 +156,11 @@
6  #endif
7  
8  /* String to execute on a file that we want to edit. */
9 -#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-vi}}"
10 +#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo vi)}}"
11  #if defined (STRICT_POSIX)
12  #  define POSIX_FC_EDIT_COMMAND "${FCEDIT:-ed}"
13  #else
14 -#  define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-ed}}"
15 +#  define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo ed)}}"
16  #endif
17  
18  int
19 --- bash/bashline.c~    2005-10-13 18:11:24.827448424 +0200
20 +++ bash/bashline.c     2005-10-13 19:37:35.382404592 +0200
21 @@ -800,8 +800,8 @@
22     command being entered (if no explicit argument is given), otherwise on
23     a command from the history file. */
24  
25 -#define VI_EDIT_COMMAND                "fc -e \"${VISUAL:-${EDITOR:-vi}}\""
26 -#define EMACS_EDIT_COMMAND     "fc -e \"${VISUAL:-${EDITOR:-emacs}}\""
27 +#define VI_EDIT_COMMAND                "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo vi)}}\""
28 +#define EMACS_EDIT_COMMAND     "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo emacs)}}\""
29  #define POSIX_VI_EDIT_COMMAND  "fc -e vi"
30  
31  static int