comparison src/memline.c @ 17454:37afc0146eab v8.1.1725

patch 8.1.1725: MS-Windows: E325 message may use incorrect date format commit https://github.com/vim/vim/commit/663bbc09babea1ff8dfa7ccd58801ac9219fc2b2 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 21 15:23:35 2019 +0200 patch 8.1.1725: MS-Windows: E325 message may use incorrect date format 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 21 Jul 2019 15:30:04 +0200
parents 6580e2dfcaeb
children 5278e5a2a4e3
comparison
equal deleted inserted replaced
17453:e67fa5e73455 17454:37afc0146eab
2140 curtime = vim_localtime(&thetime, &tmval); 2140 curtime = vim_localtime(&thetime, &tmval);
2141 /* MSVC returns NULL for an invalid value of seconds. */ 2141 /* MSVC returns NULL for an invalid value of seconds. */
2142 if (curtime == NULL) 2142 if (curtime == NULL)
2143 vim_strncpy((char_u *)buf, (char_u *)_("(Invalid)"), sizeof(buf) - 1); 2143 vim_strncpy((char_u *)buf, (char_u *)_("(Invalid)"), sizeof(buf) - 1);
2144 else 2144 else
2145 (void)strftime(buf, sizeof(buf) - 1, "%a %b %d %H:%M:%S %Y", curtime); 2145 {
2146 (void)strftime(buf, sizeof(buf) - 1, _("%a %b %d %H:%M:%S %Y"),
2147 curtime);
2148 # ifdef MSWIN
2149 if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
2150 {
2151 char_u *to_free = NULL;
2152 int len;
2153
2154 acp_to_enc((char_u *)buf, (int)strlen(buf), &to_free, &len);
2155 if (to_free != NULL)
2156 {
2157 STRCPY(buf, to_free);
2158 vim_free(to_free);
2159 }
2160 }
2161 # endif
2162 }
2146 #else 2163 #else
2147 STRCPY(buf, "(unknown)"); 2164 STRCPY(buf, "(unknown)");
2148 #endif 2165 #endif
2149 if (add_newline) 2166 if (add_newline)
2150 STRCAT(buf, "\n"); 2167 STRCAT(buf, "\n");