Mercurial > vim
comparison src/version.c @ 14171:ddf160d82971 v8.1.0103
patch 8.1.0103: long version string cannot be translated
commit https://github.com/vim/vim/commit/35fb6fbf727c72eb5987a1556bbba26dca14cc48
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 23 16:12:21 2018 +0200
patch 8.1.0103: long version string cannot be translated
Problem: Long version string cannot be translated.
Solution: Build the string in init_longVersion().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 23 Jun 2018 16:15:05 +0200 |
parents | 42a9178374d1 |
children | 4b59671bce9c |
comparison
equal
deleted
inserted
replaced
14170:9d021144571c | 14171:ddf160d82971 |
---|---|
35 # if (defined(VMS) && defined(VAXC)) || defined(PROTO) | 35 # if (defined(VMS) && defined(VAXC)) || defined(PROTO) |
36 char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__) | 36 char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__) |
37 + sizeof(__TIME__) + 3]; | 37 + sizeof(__TIME__) + 3]; |
38 | 38 |
39 void | 39 void |
40 make_version(void) | 40 init_longVersion(void) |
41 { | 41 { |
42 /* | 42 /* |
43 * Construct the long version string. Necessary because | 43 * Construct the long version string. Necessary because |
44 * VAX C can't catenate strings in the preprocessor. | 44 * VAX C can't catenate strings in the preprocessor. |
45 */ | 45 */ |
47 strcat(longVersion, __DATE__); | 47 strcat(longVersion, __DATE__); |
48 strcat(longVersion, " "); | 48 strcat(longVersion, " "); |
49 strcat(longVersion, __TIME__); | 49 strcat(longVersion, __TIME__); |
50 strcat(longVersion, ")"); | 50 strcat(longVersion, ")"); |
51 } | 51 } |
52 # else | 52 |
53 char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")"; | 53 # else |
54 void | |
55 init_longVersion(void) | |
56 { | |
57 char *date_time = __DATE__ " " __TIME__; | |
58 char *msg = _("%s (%s, compiled %s)"); | |
59 size_t len = strlen(msg) | |
60 + strlen(VIM_VERSION_LONG_ONLY) | |
61 + strlen(VIM_VERSION_DATE_ONLY) | |
62 + strlen(date_time); | |
63 | |
64 longVersion = (char *)alloc(len); | |
65 if (longVersion == NULL) | |
66 longVersion = VIM_VERSION_LONG; | |
67 else | |
68 vim_snprintf(longVersion, len, msg, | |
69 VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time); | |
70 } | |
54 # endif | 71 # endif |
55 #else | 72 #else |
56 char *longVersion = VIM_VERSION_LONG; | 73 char *longVersion = VIM_VERSION_LONG; |
57 #endif | 74 #endif |
58 | 75 |
759 NULL | 776 NULL |
760 }; | 777 }; |
761 | 778 |
762 static int included_patches[] = | 779 static int included_patches[] = |
763 { /* Add new patch number below this line */ | 780 { /* Add new patch number below this line */ |
781 /**/ | |
782 103, | |
764 /**/ | 783 /**/ |
765 102, | 784 102, |
766 /**/ | 785 /**/ |
767 101, | 786 101, |
768 /**/ | 787 /**/ |
1146 | 1165 |
1147 /* | 1166 /* |
1148 * When adding features here, don't forget to update the list of | 1167 * When adding features here, don't forget to update the list of |
1149 * internal variables in eval.c! | 1168 * internal variables in eval.c! |
1150 */ | 1169 */ |
1170 init_longVersion(); | |
1151 MSG(longVersion); | 1171 MSG(longVersion); |
1152 #ifdef WIN3264 | 1172 #ifdef WIN3264 |
1153 # ifdef FEAT_GUI_W32 | 1173 # ifdef FEAT_GUI_W32 |
1154 # ifdef _WIN64 | 1174 # ifdef _WIN64 |
1155 MSG_PUTS(_("\nMS-Windows 64-bit GUI version")); | 1175 MSG_PUTS(_("\nMS-Windows 64-bit GUI version")); |