]> granicus.if.org Git - vim/commitdiff
patch 7.4.2029 v7.4.2029
authorBram Moolenaar <Bram@vim.org>
Tue, 12 Jul 2016 19:11:33 +0000 (21:11 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 12 Jul 2016 19:11:33 +0000 (21:11 +0200)
Problem:    printf() does not work with 64 bit numbers.
Solution:   use the "L" length modifier. (Ken Takata)

src/message.c
src/testdir/test_expr.vim
src/version.c

index 7bb154d2e9213d9e787dad6d4548f40be2bad7f4..954152850c5ce944f22333b77f390062094d364f 100644 (file)
@@ -4198,6 +4198,15 @@ vim_vsnprintf(
                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 */
            switch (fmt_spec)
            {
index 067dbf24f63d325963652ebcb04c61b9b53f277d..86c86c58d5a853fa31f2ecd399a7b5c8fbd50ccd 100644 (file)
@@ -129,3 +129,9 @@ func Test_option_value()
   call assert_equal("abcdefgi", &cpo)
   set cpo&vim
 endfunc
+
+function Test_printf_64bit()
+  if has('num64')
+    call assert_equal("123456789012345", printf('%d', 123456789012345))
+  endif
+endfunc
index 6d75f76f1d5522f6adfe34ff25901e0c7c4e1c34..301b406d27a527f37b09896359e7aa6217ba30a7 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2029,
 /**/
     2028,
 /**/