diff --git a/7.4.154 b/7.4.154 new file mode 100644 index 0000000..db5ae62 --- /dev/null +++ b/7.4.154 @@ -0,0 +1,153 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.154 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.154 (after 7.4.149) +Problem: Still a problem with auto-loading. +Solution: Pass no_autoload to deref_func_name(). (Yukihiro Nakadaira) +Files: src/eval.c + + +*** ../vim-7.4.153/src/eval.c 2014-01-14 16:36:40.000000000 +0100 +--- src/eval.c 2014-01-14 19:40:36.000000000 +0100 +*************** +*** 447,453 **** + #endif + static int get_env_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); + static int find_internal_func __ARGS((char_u *name)); +! static char_u *deref_func_name __ARGS((char_u *name, int *lenp)); + static int get_func_tv __ARGS((char_u *name, int len, typval_T *rettv, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict)); + static int call_func __ARGS((char_u *funcname, int len, typval_T *rettv, int argcount, typval_T *argvars, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict)); + static void emsg_funcname __ARGS((char *ermsg, char_u *name)); +--- 447,453 ---- + #endif + static int get_env_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); + static int find_internal_func __ARGS((char_u *name)); +! static char_u *deref_func_name __ARGS((char_u *name, int *lenp, int no_autoload)); + static int get_func_tv __ARGS((char_u *name, int len, typval_T *rettv, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict)); + static int call_func __ARGS((char_u *funcname, int len, typval_T *rettv, int argcount, typval_T *argvars, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict)); + static void emsg_funcname __ARGS((char *ermsg, char_u *name)); +*************** +*** 3432,3438 **** + + /* If it is the name of a variable of type VAR_FUNC use its contents. */ + len = (int)STRLEN(tofree); +! name = deref_func_name(tofree, &len); + + /* Skip white space to allow ":call func ()". Not good, but required for + * backward compatibility. */ +--- 3432,3438 ---- + + /* If it is the name of a variable of type VAR_FUNC use its contents. */ + len = (int)STRLEN(tofree); +! name = deref_func_name(tofree, &len, FALSE); + + /* Skip white space to allow ":call func ()". Not good, but required for + * backward compatibility. */ +*************** +*** 5159,5165 **** + { + /* If "s" is the name of a variable of type VAR_FUNC + * use its contents. */ +! s = deref_func_name(s, &len); + + /* Invoke the function. */ + ret = get_func_tv(s, len, rettv, arg, +--- 5159,5165 ---- + { + /* If "s" is the name of a variable of type VAR_FUNC + * use its contents. */ +! s = deref_func_name(s, &len, FALSE); + + /* Invoke the function. */ + ret = get_func_tv(s, len, rettv, arg, +*************** +*** 8291,8306 **** + * name it contains, otherwise return "name". + */ + static char_u * +! deref_func_name(name, lenp) + char_u *name; + int *lenp; + { + dictitem_T *v; + int cc; + + cc = name[*lenp]; + name[*lenp] = NUL; +! v = find_var(name, NULL, FALSE); + name[*lenp] = cc; + if (v != NULL && v->di_tv.v_type == VAR_FUNC) + { +--- 8291,8307 ---- + * name it contains, otherwise return "name". + */ + static char_u * +! deref_func_name(name, lenp, no_autoload) + char_u *name; + int *lenp; ++ int no_autoload; + { + dictitem_T *v; + int cc; + + cc = name[*lenp]; + name[*lenp] = NUL; +! v = find_var(name, NULL, no_autoload); + name[*lenp] = cc; + if (v != NULL && v->di_tv.v_type == VAR_FUNC) + { +*************** +*** 21947,21960 **** + if (lv.ll_exp_name != NULL) + { + len = (int)STRLEN(lv.ll_exp_name); +! name = deref_func_name(lv.ll_exp_name, &len); + if (name == lv.ll_exp_name) + name = NULL; + } + else + { + len = (int)(end - *pp); +! name = deref_func_name(*pp, &len); + if (name == *pp) + name = NULL; + } +--- 21948,21961 ---- + if (lv.ll_exp_name != NULL) + { + len = (int)STRLEN(lv.ll_exp_name); +! name = deref_func_name(lv.ll_exp_name, &len, flags & TFN_NO_AUTOLOAD); + if (name == lv.ll_exp_name) + name = NULL; + } + else + { + len = (int)(end - *pp); +! name = deref_func_name(*pp, &len, flags & TFN_NO_AUTOLOAD); + if (name == *pp) + name = NULL; + } +*** ../vim-7.4.153/src/version.c 2014-01-14 19:35:49.000000000 +0100 +--- src/version.c 2014-01-14 19:42:05.000000000 +0100 +*************** +*** 740,741 **** +--- 740,743 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 154, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +162. You go outside and look for a brightness knob to turn down the sun. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org ///