vim-patch:9.0.1380: CTRL-X on 2**64 subtracts two (#22530)

Problem:    CTRL-X on 2**64 subtracts two. (James McCoy)
Solution:   Correct computation for large number. (closes vim/vim#12103)

5fb78c3fa5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-03-05 09:18:42 +08:00
committed by GitHub
parent b44b8e7687
commit 419819b624
13 changed files with 48 additions and 19 deletions

View File

@@ -580,7 +580,7 @@ void ex_sort(exarg_T *eap)
}
if (sort_nr || sort_flt) {
// Make sure vim_str2nr doesn't read any digits past the end
// Make sure vim_str2nr() doesn't read any digits past the end
// of the match, by temporarily terminating the string there
s2 = s + end_col;
c = *s2;
@@ -605,7 +605,7 @@ void ex_sort(exarg_T *eap)
} else {
nrs[lnum - eap->line1].st_u.num.is_number = true;
vim_str2nr(s, NULL, NULL, sort_what,
&nrs[lnum - eap->line1].st_u.num.value, NULL, 0, false);
&nrs[lnum - eap->line1].st_u.num.value, NULL, 0, false, NULL);
}
} else {
s = skipwhite(p);