]>
Commit | Line | Data |
---|---|---|
46534d20 AM |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.614 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.614 | |
11 | Problem: Number argument gets turned into a number while it should be a | |
12 | string. | |
13 | Solution: Add flag to the call_vim_function() call. (Yasuhiro Matsumoto) | |
14 | Files: src/edit.c, src/eval.c, src/proto/eval.pro | |
15 | ||
16 | ||
17 | *** ../vim-7.3.613/src/edit.c 2012-07-10 17:14:50.000000000 +0200 | |
18 | --- src/edit.c 2012-07-25 16:40:07.000000000 +0200 | |
19 | *************** | |
20 | *** 3959,3965 **** | |
21 | curbuf_save = curbuf; | |
22 | ||
23 | /* Call a function, which returns a list or dict. */ | |
24 | ! if (call_vim_function(funcname, 2, args, FALSE, &rettv) == OK) | |
25 | { | |
26 | switch (rettv.v_type) | |
27 | { | |
28 | --- 3959,3965 ---- | |
29 | curbuf_save = curbuf; | |
30 | ||
31 | /* Call a function, which returns a list or dict. */ | |
32 | ! if (call_vim_function(funcname, 2, args, FALSE, FALSE, &rettv) == OK) | |
33 | { | |
34 | switch (rettv.v_type) | |
35 | { | |
36 | *** ../vim-7.3.613/src/eval.c 2012-07-19 18:05:40.000000000 +0200 | |
37 | --- src/eval.c 2012-07-25 16:42:41.000000000 +0200 | |
38 | *************** | |
39 | *** 1564,1574 **** | |
40 | * Returns OK or FAIL. | |
41 | */ | |
42 | int | |
43 | ! call_vim_function(func, argc, argv, safe, rettv) | |
44 | char_u *func; | |
45 | int argc; | |
46 | char_u **argv; | |
47 | int safe; /* use the sandbox */ | |
48 | typval_T *rettv; | |
49 | { | |
50 | typval_T *argvars; | |
51 | --- 1564,1575 ---- | |
52 | * Returns OK or FAIL. | |
53 | */ | |
54 | int | |
55 | ! call_vim_function(func, argc, argv, safe, str_arg_only, rettv) | |
56 | char_u *func; | |
57 | int argc; | |
58 | char_u **argv; | |
59 | int safe; /* use the sandbox */ | |
60 | + int str_arg_only; /* all arguments are strings */ | |
61 | typval_T *rettv; | |
62 | { | |
63 | typval_T *argvars; | |
64 | *************** | |
65 | *** 1593,1600 **** | |
66 | continue; | |
67 | } | |
68 | ||
69 | ! /* Recognize a number argument, the others must be strings. */ | |
70 | ! vim_str2nr(argv[i], NULL, &len, TRUE, TRUE, &n, NULL); | |
71 | if (len != 0 && len == (int)STRLEN(argv[i])) | |
72 | { | |
73 | argvars[i].v_type = VAR_NUMBER; | |
74 | --- 1594,1604 ---- | |
75 | continue; | |
76 | } | |
77 | ||
78 | ! if (str_arg_only) | |
79 | ! len = 0; | |
80 | ! else | |
81 | ! /* Recognize a number argument, the others must be strings. */ | |
82 | ! vim_str2nr(argv[i], NULL, &len, TRUE, TRUE, &n, NULL); | |
83 | if (len != 0 && len == (int)STRLEN(argv[i])) | |
84 | { | |
85 | argvars[i].v_type = VAR_NUMBER; | |
86 | *************** | |
87 | *** 1646,1652 **** | |
88 | typval_T rettv; | |
89 | char_u *retval; | |
90 | ||
91 | ! if (call_vim_function(func, argc, argv, safe, &rettv) == FAIL) | |
92 | return NULL; | |
93 | ||
94 | retval = vim_strsave(get_tv_string(&rettv)); | |
95 | --- 1650,1657 ---- | |
96 | typval_T rettv; | |
97 | char_u *retval; | |
98 | ||
99 | ! /* All arguments are passed as strings, no conversion to number. */ | |
100 | ! if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) | |
101 | return NULL; | |
102 | ||
103 | retval = vim_strsave(get_tv_string(&rettv)); | |
104 | *************** | |
105 | *** 1671,1677 **** | |
106 | typval_T rettv; | |
107 | long retval; | |
108 | ||
109 | ! if (call_vim_function(func, argc, argv, safe, &rettv) == FAIL) | |
110 | return -1; | |
111 | ||
112 | retval = get_tv_number_chk(&rettv, NULL); | |
113 | --- 1676,1683 ---- | |
114 | typval_T rettv; | |
115 | long retval; | |
116 | ||
117 | ! /* All arguments are passed as strings, no conversion to number. */ | |
118 | ! if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) | |
119 | return -1; | |
120 | ||
121 | retval = get_tv_number_chk(&rettv, NULL); | |
122 | *************** | |
123 | *** 1694,1700 **** | |
124 | { | |
125 | typval_T rettv; | |
126 | ||
127 | ! if (call_vim_function(func, argc, argv, safe, &rettv) == FAIL) | |
128 | return NULL; | |
129 | ||
130 | if (rettv.v_type != VAR_LIST) | |
131 | --- 1700,1707 ---- | |
132 | { | |
133 | typval_T rettv; | |
134 | ||
135 | ! /* All arguments are passed as strings, no conversion to number. */ | |
136 | ! if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) | |
137 | return NULL; | |
138 | ||
139 | if (rettv.v_type != VAR_LIST) | |
140 | *** ../vim-7.3.613/src/proto/eval.pro 2012-07-16 17:31:48.000000000 +0200 | |
141 | --- src/proto/eval.pro 2012-07-25 16:42:59.000000000 +0200 | |
142 | *************** | |
143 | *** 23,29 **** | |
144 | list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr)); | |
145 | int get_spellword __ARGS((list_T *list, char_u **pp)); | |
146 | typval_T *eval_expr __ARGS((char_u *arg, char_u **nextcmd)); | |
147 | ! int call_vim_function __ARGS((char_u *func, int argc, char_u **argv, int safe, typval_T *rettv)); | |
148 | void *call_func_retstr __ARGS((char_u *func, int argc, char_u **argv, int safe)); | |
149 | long call_func_retnr __ARGS((char_u *func, int argc, char_u **argv, int safe)); | |
150 | void *call_func_retlist __ARGS((char_u *func, int argc, char_u **argv, int safe)); | |
151 | --- 23,29 ---- | |
152 | list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr)); | |
153 | int get_spellword __ARGS((list_T *list, char_u **pp)); | |
154 | typval_T *eval_expr __ARGS((char_u *arg, char_u **nextcmd)); | |
155 | ! int call_vim_function __ARGS((char_u *func, int argc, char_u **argv, int safe, int str_arg_only, typval_T *rettv)); | |
156 | void *call_func_retstr __ARGS((char_u *func, int argc, char_u **argv, int safe)); | |
157 | long call_func_retnr __ARGS((char_u *func, int argc, char_u **argv, int safe)); | |
158 | void *call_func_retlist __ARGS((char_u *func, int argc, char_u **argv, int safe)); | |
159 | *** ../vim-7.3.613/src/version.c 2012-07-25 16:32:03.000000000 +0200 | |
160 | --- src/version.c 2012-07-25 16:46:11.000000000 +0200 | |
161 | *************** | |
162 | *** 716,717 **** | |
163 | --- 716,719 ---- | |
164 | { /* Add new patch number below this line */ | |
165 | + /**/ | |
166 | + 614, | |
167 | /**/ | |
168 | ||
169 | -- | |
170 | hundred-and-one symptoms of being an internet addict: | |
171 | 171. You invent another person and chat with yourself in empty chat rooms. | |
172 | ||
173 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
174 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
175 | \\\ an exciting new programming language -- http://www.Zimbu.org /// | |
176 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |