comparison src/eval.c @ 2655:d94c32250814 v7.3.075

updated for version 7.3.075 Problem: Missing part of 'wildignorecase' Solution: Also adjust expand()
author Bram Moolenaar <bram@vim.org>
date Thu, 02 Dec 2010 21:44:40 +0100
parents 2b475ed86e64
children 1a0d346695fa
comparison
equal deleted inserted replaced
2654:2b475ed86e64 2655:d94c32250814
9874 typval_T *rettv; 9874 typval_T *rettv;
9875 { 9875 {
9876 char_u *s; 9876 char_u *s;
9877 int len; 9877 int len;
9878 char_u *errormsg; 9878 char_u *errormsg;
9879 int flags = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND; 9879 int options = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND;
9880 expand_T xpc; 9880 expand_T xpc;
9881 int error = FALSE; 9881 int error = FALSE;
9882 9882
9883 rettv->v_type = VAR_STRING; 9883 rettv->v_type = VAR_STRING;
9884 s = get_tv_string(&argvars[0]); 9884 s = get_tv_string(&argvars[0]);
9892 { 9892 {
9893 /* When the optional second argument is non-zero, don't remove matches 9893 /* When the optional second argument is non-zero, don't remove matches
9894 * for 'wildignore' and don't put matches for 'suffixes' at the end. */ 9894 * for 'wildignore' and don't put matches for 'suffixes' at the end. */
9895 if (argvars[1].v_type != VAR_UNKNOWN 9895 if (argvars[1].v_type != VAR_UNKNOWN
9896 && get_tv_number_chk(&argvars[1], &error)) 9896 && get_tv_number_chk(&argvars[1], &error))
9897 flags |= WILD_KEEP_ALL; 9897 options |= WILD_KEEP_ALL;
9898 if (!error) 9898 if (!error)
9899 { 9899 {
9900 ExpandInit(&xpc); 9900 ExpandInit(&xpc);
9901 xpc.xp_context = EXPAND_FILES; 9901 xpc.xp_context = EXPAND_FILES;
9902 rettv->vval.v_string = ExpandOne(&xpc, s, NULL, flags, WILD_ALL); 9902 if (p_wic)
9903 options += WILD_ICASE;
9904 rettv->vval.v_string = ExpandOne(&xpc, s, NULL, options, WILD_ALL);
9903 } 9905 }
9904 else 9906 else
9905 rettv->vval.v_string = NULL; 9907 rettv->vval.v_string = NULL;
9906 } 9908 }
9907 } 9909 }
11670 static void 11672 static void
11671 f_glob(argvars, rettv) 11673 f_glob(argvars, rettv)
11672 typval_T *argvars; 11674 typval_T *argvars;
11673 typval_T *rettv; 11675 typval_T *rettv;
11674 { 11676 {
11675 int flags = WILD_SILENT|WILD_USE_NL; 11677 int options = WILD_SILENT|WILD_USE_NL;
11676 expand_T xpc; 11678 expand_T xpc;
11677 int error = FALSE; 11679 int error = FALSE;
11678 11680
11679 /* When the optional second argument is non-zero, don't remove matches 11681 /* When the optional second argument is non-zero, don't remove matches
11680 * for 'wildignore' and don't put matches for 'suffixes' at the end. */ 11682 * for 'wildignore' and don't put matches for 'suffixes' at the end. */
11681 if (argvars[1].v_type != VAR_UNKNOWN 11683 if (argvars[1].v_type != VAR_UNKNOWN
11682 && get_tv_number_chk(&argvars[1], &error)) 11684 && get_tv_number_chk(&argvars[1], &error))
11683 flags |= WILD_KEEP_ALL; 11685 options |= WILD_KEEP_ALL;
11684 rettv->v_type = VAR_STRING; 11686 rettv->v_type = VAR_STRING;
11685 if (!error) 11687 if (!error)
11686 { 11688 {
11687 ExpandInit(&xpc); 11689 ExpandInit(&xpc);
11688 xpc.xp_context = EXPAND_FILES; 11690 xpc.xp_context = EXPAND_FILES;
11691 if (p_wic)
11692 options += WILD_ICASE;
11689 rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]), 11693 rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
11690 NULL, flags, WILD_ALL); 11694 NULL, options, WILD_ALL);
11691 } 11695 }
11692 else 11696 else
11693 rettv->vval.v_string = NULL; 11697 rettv->vval.v_string = NULL;
11694 } 11698 }
11695 11699