vim-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 vim/vim#4685, closes vim/vim#4681)
663bbc09ba
This commit is contained in:
Jan Edmund Lazo
2020-08-28 09:49:49 -04:00
parent b3f5083b8d
commit 269a271a10

View File

@@ -172,10 +172,11 @@ char *os_ctime_r(const time_t *restrict clock, char *restrict result,
struct tm *clock_local_ptr = os_localtime_r(clock, &clock_local);
// MSVC returns NULL for an invalid value of seconds.
if (clock_local_ptr == NULL) {
snprintf(result, result_len, "%s\n", _("(Invalid)"));
xstrlcpy(result, _("(Invalid)"), result_len);
} else {
strftime(result, result_len, "%a %b %d %H:%M:%S %Y\n", clock_local_ptr);
strftime(result, result_len, _("%a %b %d %H:%M:%S %Y"), clock_local_ptr);
}
xstrlcat(result, "\n", result_len);
return result;
}