mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 7.4.2029
Problem: printf() does not work with 64 bit numbers. Solution: use the "L" length modifier. (Ken Takata)
This commit is contained in:
@@ -4198,6 +4198,15 @@ vim_vsnprintf(
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if defined(FEAT_EVAL) && defined(FEAT_NUM64)
|
||||||
|
switch (fmt_spec)
|
||||||
|
{
|
||||||
|
case 'd': case 'u': case 'o': case 'x': case 'X':
|
||||||
|
if (tvs != NULL && length_modifier == '\0')
|
||||||
|
length_modifier = 'L';
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
/* get parameter value, do initial processing */
|
/* get parameter value, do initial processing */
|
||||||
switch (fmt_spec)
|
switch (fmt_spec)
|
||||||
{
|
{
|
||||||
|
@@ -129,3 +129,9 @@ func Test_option_value()
|
|||||||
call assert_equal("abcdefgi", &cpo)
|
call assert_equal("abcdefgi", &cpo)
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
function Test_printf_64bit()
|
||||||
|
if has('num64')
|
||||||
|
call assert_equal("123456789012345", printf('%d', 123456789012345))
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
@@ -758,6 +758,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2029,
|
||||||
/**/
|
/**/
|
||||||
2028,
|
2028,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user