Skip to content

Commit

Permalink
only enable globstar setting, if bash version is larger 4
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Sep 22, 2023
1 parent 26b5647 commit edbae77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/os_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -6703,15 +6703,15 @@ mch_expand_wildcards(
#define STYLE_PRINT 3 // use "print -N", for zsh
#define STYLE_BT 4 // `cmd` expansion, execute the pattern directly
#define STYLE_GLOBSTAR 5 // use extended shell glob for bash (this uses extended
// globbing functionality using globstar)
// globbing functionality using globstar, needs bash > 4)
int shell_style = STYLE_ECHO;
int check_spaces;
static int did_find_nul = FALSE;
int ampersand = FALSE;
// vimglob() function to define for Posix shell
static char *sh_vimglob_func = "vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >";
// globstar() function with globstar setting enabled
static char *sh_globstar_opt = "shopt -s globstar; ";
// vimglob() function with globstar setting enabled, only for bash >= 4.X
static char *sh_globstar_opt = "[[ ${BASH_VERSINFO[0]} -ge 4 ]] && shopt -s globstar; ";

*num_file = 0; // default: no files found
*file = NULL;
Expand Down

0 comments on commit edbae77

Please sign in to comment.