Mercurial > vim
comparison src/evalfunc.c @ 17588:1348696d07cd v8.1.1791
patch 8.1.1791: 'completeslash' also applies to globpath()
commit https://github.com/vim/vim/commit/50f91d22bd81819d5d946f6c38252c7922120ec6
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 2 19:52:15 2019 +0200
patch 8.1.1791: 'completeslash' also applies to globpath()
Problem: 'completeslash' also applies to globpath().
Solution: Add the WILD_IGNORE_COMPLETESLASH flag. (test by Yasuhiro
Matsumoto, closes #4760)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 02 Aug 2019 20:00:07 +0200 |
parents | 97a750e8707f |
children | e259d11e2900 |
comparison
equal
deleted
inserted
replaced
17587:f4d6636bc399 | 17588:1348696d07cd |
---|---|
5876 * "globpath()" function | 5876 * "globpath()" function |
5877 */ | 5877 */ |
5878 static void | 5878 static void |
5879 f_globpath(typval_T *argvars, typval_T *rettv) | 5879 f_globpath(typval_T *argvars, typval_T *rettv) |
5880 { | 5880 { |
5881 int flags = 0; | 5881 int flags = WILD_IGNORE_COMPLETESLASH; |
5882 char_u buf1[NUMBUFLEN]; | 5882 char_u buf1[NUMBUFLEN]; |
5883 char_u *file = tv_get_string_buf_chk(&argvars[1], buf1); | 5883 char_u *file = tv_get_string_buf_chk(&argvars[1], buf1); |
5884 int error = FALSE; | 5884 int error = FALSE; |
5885 garray_T ga; | 5885 garray_T ga; |
5886 int i; | 5886 int i; |
5887 | 5887 |
5888 /* When the optional second argument is non-zero, don't remove matches | 5888 // When the optional second argument is non-zero, don't remove matches |
5889 * for 'wildignore' and don't put matches for 'suffixes' at the end. */ | 5889 // for 'wildignore' and don't put matches for 'suffixes' at the end. |
5890 rettv->v_type = VAR_STRING; | 5890 rettv->v_type = VAR_STRING; |
5891 if (argvars[2].v_type != VAR_UNKNOWN) | 5891 if (argvars[2].v_type != VAR_UNKNOWN) |
5892 { | 5892 { |
5893 if (tv_get_number_chk(&argvars[2], &error)) | 5893 if (tv_get_number_chk(&argvars[2], &error)) |
5894 flags |= WILD_KEEP_ALL; | 5894 flags |= WILD_KEEP_ALL; |