]> granicus.if.org Git - vim/commitdiff
patch 8.1.1725: MS-Windows: E325 message may use incorrect date format v8.1.1725
authorBram Moolenaar <Bram@vim.org>
Sun, 21 Jul 2019 13:23:35 +0000 (15:23 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 21 Jul 2019 13:23:35 +0000 (15:23 +0200)
Problem:    MS-Windows: E325 message may use incorrect date format.
Solution:   Convert strftime() result to 'encoding'.  Also make the message
            translatable. (Ken Takata, closes #4685, closes #4681)

src/memline.c
src/version.c

index 0a947f9273f66f2509406f02c79c113185ea0bab..e401c73fa20709df6b70533b334387ccdaba7ed8 100644 (file)
@@ -2142,7 +2142,24 @@ get_ctime(time_t thetime, int add_newline)
     if (curtime == NULL)
        vim_strncpy((char_u *)buf, (char_u *)_("(Invalid)"), sizeof(buf) - 1);
     else
-       (void)strftime(buf, sizeof(buf) - 1, "%a %b %d %H:%M:%S %Y", curtime);
+    {
+       (void)strftime(buf, sizeof(buf) - 1, _("%a %b %d %H:%M:%S %Y"),
+                                                                   curtime);
+# ifdef MSWIN
+       if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+       {
+           char_u      *to_free = NULL;
+           int         len;
+
+           acp_to_enc((char_u *)buf, (int)strlen(buf), &to_free, &len);
+           if (to_free != NULL)
+           {
+               STRCPY(buf, to_free);
+               vim_free(to_free);
+           }
+       }
+# endif
+    }
 #else
     STRCPY(buf, "(unknown)");
 #endif
index 8a98f510a47bfe2b768f42533eb7aab042608504..afdefb270868c2f5de4600217b0c6408a99ca58f 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1725,
 /**/
     1724,
 /**/