mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 07:18:17 +00:00
vim-patch:8.0.1242: function argument with only dash is seen as number zero
Problem: Function argument with only dash is seen as number zero. (Wang
Shidong)
Solution: See a dash as a string. (Christian Brabandt)
ffd99f729b
This commit is contained in:
@@ -1210,8 +1210,12 @@ int call_vim_function(
|
||||
if (str_arg_only) {
|
||||
len = 0;
|
||||
} else {
|
||||
// Recognize a number argument, the others must be strings.
|
||||
// Recognize a number argument, the others must be strings. A dash
|
||||
// is a string too.
|
||||
vim_str2nr(argv[i], NULL, &len, STR2NR_ALL, &n, NULL, 0);
|
||||
if (len == 1 && *argv[i] == '-') {
|
||||
len = 0;
|
||||
}
|
||||
}
|
||||
if (len != 0 && len == (int)STRLEN(argv[i])) {
|
||||
argvars[i].v_type = VAR_NUMBER;
|
||||
|
Reference in New Issue
Block a user