summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0103
blob: 502f643d9707f359f751eca1212efc3e6c7fc5f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0103
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0103
Problem:    Long version string cannot be translated.
Solution:   Build the string in init_longVersion().
Files:	    src/globals.h, src/version.h, src/version.c,
            src/proto/version.pro, src/main.c


*** ../vim-8.1.0102/src/globals.h	2018-06-23 14:21:38.467484932 +0200
--- src/globals.h	2018-06-23 15:43:26.522795007 +0200
***************
*** 1131,1142 ****
  EXTERN char	breakat_flags[256];	/* which characters are in 'breakat' */
  #endif
  
! /* these are in version.c */
  extern char *Version;
  #if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC)
  extern char longVersion[];
  #else
! extern char *longVersion;
  #endif
  
  /*
--- 1131,1142 ----
  EXTERN char	breakat_flags[256];	/* which characters are in 'breakat' */
  #endif
  
! /* These are in version.c, call init_longVersion() before use. */
  extern char *Version;
  #if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC)
  extern char longVersion[];
  #else
! EXTERN char *longVersion;
  #endif
  
  /*
*** ../vim-8.1.0102/src/version.h	2018-05-17 13:33:02.000000000 +0200
--- src/version.h	2018-06-23 15:35:20.481563682 +0200
***************
*** 36,40 ****
  #define VIM_VERSION_NODOT	"vim81"
  #define VIM_VERSION_SHORT	"8.1"
  #define VIM_VERSION_MEDIUM	"8.1"
! #define VIM_VERSION_LONG	"VIM - Vi IMproved 8.1 (2018 May 18)"
! #define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 8.1 (2018 May 18, compiled "
--- 36,42 ----
  #define VIM_VERSION_NODOT	"vim81"
  #define VIM_VERSION_SHORT	"8.1"
  #define VIM_VERSION_MEDIUM	"8.1"
! #define VIM_VERSION_LONG	"VIM - Vi IMproved 8.1 (2018 May 18)"
! #define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 8.1 (2018 May 18, compiled "
! #define VIM_VERSION_LONG_ONLY	"VIM - Vi IMproved 8.1"
! #define VIM_VERSION_DATE_ONLY	"2018 May 18"
*** ../vim-8.1.0102/src/version.c	2018-06-23 15:09:02.351412460 +0200
--- src/version.c	2018-06-23 16:11:00.128696631 +0200
***************
*** 37,43 ****
  						      + sizeof(__TIME__) + 3];
  
      void
! make_version(void)
  {
      /*
       * Construct the long version string.  Necessary because
--- 37,43 ----
  						      + sizeof(__TIME__) + 3];
  
      void
! init_longVersion(void)
  {
      /*
       * Construct the long version string.  Necessary because
***************
*** 49,56 ****
      strcat(longVersion, __TIME__);
      strcat(longVersion, ")");
  }
  # else
! char	*longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
  # endif
  #else
  char	*longVersion = VIM_VERSION_LONG;
--- 49,73 ----
      strcat(longVersion, __TIME__);
      strcat(longVersion, ")");
  }
+ 
  # else
!     void
! init_longVersion(void)
! {
!     char *date_time = __DATE__ " " __TIME__;
!     char *msg = _("%s (%s, compiled %s)");
!     size_t len = strlen(msg)
! 		+ strlen(VIM_VERSION_LONG_ONLY)
! 		+ strlen(VIM_VERSION_DATE_ONLY)
! 		+ strlen(date_time);
! 
!     longVersion = (char *)alloc(len);
!     if (longVersion == NULL)
! 	longVersion = VIM_VERSION_LONG;
!     else
! 	vim_snprintf(longVersion, len, msg,
! 		      VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time);
! }
  # endif
  #else
  char	*longVersion = VIM_VERSION_LONG;
***************
*** 1148,1153 ****
--- 1167,1173 ----
       * When adding features here, don't forget to update the list of
       * internal variables in eval.c!
       */
+     init_longVersion();
      MSG(longVersion);
  #ifdef WIN3264
  # ifdef FEAT_GUI_W32
*** ../vim-8.1.0102/src/proto/version.pro	2018-05-17 13:52:55.000000000 +0200
--- src/proto/version.pro	2018-06-23 15:40:19.395834338 +0200
***************
*** 1,5 ****
  /* version.c */
! void make_version(void);
  int highest_patch(void);
  int has_patch(int n);
  void ex_version(exarg_T *eap);
--- 1,5 ----
  /* version.c */
! void init_longVersion(void);
  int highest_patch(void);
  int has_patch(int n);
  void ex_version(exarg_T *eap);
*** ../vim-8.1.0102/src/main.c	2018-06-21 21:38:29.599534681 +0200
--- src/main.c	2018-06-23 15:31:50.962855677 +0200
***************
*** 940,949 ****
      /* Init the table of Normal mode commands. */
      init_normal_cmds();
  
- #if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC)
-     make_version();	/* Construct the long version string. */
- #endif
- 
      /*
       * Allocate space for the generic buffers (needed for set_init_1() and
       * EMSG2()).
--- 940,945 ----
***************
*** 3215,3220 ****
--- 3211,3217 ----
      reset_signals();		/* kill us with CTRL-C here, if you like */
  #endif
  
+     init_longVersion();
      mch_errmsg(longVersion);
      mch_errmsg("\n");
      mch_errmsg(_(main_errors[n]));
***************
*** 3268,3273 ****
--- 3265,3271 ----
      reset_signals();		/* kill us with CTRL-C here, if you like */
  #endif
  
+     init_longVersion();
      mch_msg(longVersion);
      mch_msg(_("\n\nUsage:"));
      for (i = 0; ; ++i)
*** ../vim-8.1.0102/src/version.c	2018-06-23 15:09:02.351412460 +0200
--- src/version.c	2018-06-23 16:11:00.128696631 +0200
***************
*** 763,764 ****
--- 780,783 ----
  {   /* Add new patch number below this line */
+ /**/
+     103,
  /**/

-- 
From "know your smileys":
 |-(	Contact lenses, but has lost them

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///