summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.3.276
blob: 3af02457d1ceff6741c763744b4198564cb82535 (plain) (blame)
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
To: vim_dev@googlegroups.com
Subject: Patch 7.3.276
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.276
Problem:    GvimExt sets $LANG in the wrong way.
Solution:   Save the environment and use it for gvim. (Yasuhiro Matsumoto)
Files:	    src/GvimExt/gvimext.cpp


*** ../vim-7.3.275/src/GvimExt/gvimext.cpp	2011-07-20 17:27:17.000000000 +0200
--- src/GvimExt/gvimext.cpp	2011-08-10 16:25:32.000000000 +0200
***************
*** 142,147 ****
--- 142,148 ----
  static int dyn_libintl_init(char *dir);
  static void dyn_libintl_end(void);
  
+ static wchar_t *oldenv = NULL;
  static HINSTANCE hLibintlDLL = 0;
  static char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
  static char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain;
***************
*** 339,346 ****
  inc_cRefThisDLL()
  {
  #ifdef FEAT_GETTEXT
!     if (g_cRefThisDll == 0)
  	dyn_gettext_load();
  #endif
      InterlockedIncrement((LPLONG)&g_cRefThisDll);
  }
--- 340,349 ----
  inc_cRefThisDLL()
  {
  #ifdef FEAT_GETTEXT
!     if (g_cRefThisDll == 0) {
  	dyn_gettext_load();
+ 	oldenv = GetEnvironmentStringsW();
+     }
  #endif
      InterlockedIncrement((LPLONG)&g_cRefThisDll);
  }
***************
*** 349,356 ****
  dec_cRefThisDLL()
  {
  #ifdef FEAT_GETTEXT
!     if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0)
  	dyn_gettext_free();
  #else
      InterlockedDecrement((LPLONG)&g_cRefThisDll);
  #endif
--- 352,364 ----
  dec_cRefThisDLL()
  {
  #ifdef FEAT_GETTEXT
!     if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) {
  	dyn_gettext_free();
+ 	if (oldenv != NULL) {
+ 	    FreeEnvironmentStringsW(oldenv);
+ 	    oldenv = NULL;
+ 	}
+     }
  #else
      InterlockedDecrement((LPLONG)&g_cRefThisDll);
  #endif
***************
*** 905,912 ****
  			NULL,		// Process handle not inheritable.
  			NULL,		// Thread handle not inheritable.
  			FALSE,		// Set handle inheritance to FALSE.
! 			0,		// No creation flags.
! 			NULL,		// Use parent's environment block.
  			NULL,		// Use parent's starting directory.
  			&si,		// Pointer to STARTUPINFO structure.
  			&pi)		// Pointer to PROCESS_INFORMATION structure.
--- 913,920 ----
  			NULL,		// Process handle not inheritable.
  			NULL,		// Thread handle not inheritable.
  			FALSE,		// Set handle inheritance to FALSE.
! 			oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT,
! 			oldenv,		// Use unmodified environment block.
  			NULL,		// Use parent's starting directory.
  			&si,		// Pointer to STARTUPINFO structure.
  			&pi)		// Pointer to PROCESS_INFORMATION structure.
***************
*** 987,994 ****
  		NULL,		// Process handle not inheritable.
  		NULL,		// Thread handle not inheritable.
  		FALSE,		// Set handle inheritance to FALSE.
! 		0,		// No creation flags.
! 		NULL,		// Use parent's environment block.
  		NULL,		// Use parent's starting directory.
  		&si,		// Pointer to STARTUPINFO structure.
  		&pi)		// Pointer to PROCESS_INFORMATION structure.
--- 995,1002 ----
  		NULL,		// Process handle not inheritable.
  		NULL,		// Thread handle not inheritable.
  		FALSE,		// Set handle inheritance to FALSE.
! 		oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT,
! 		oldenv,		// Use unmodified environment block.
  		NULL,		// Use parent's starting directory.
  		&si,		// Pointer to STARTUPINFO structure.
  		&pi)		// Pointer to PROCESS_INFORMATION structure.
*** ../vim-7.3.275/src/version.c	2011-08-10 15:56:24.000000000 +0200
--- src/version.c	2011-08-10 16:28:42.000000000 +0200
***************
*** 711,712 ****
--- 711,714 ----
  {   /* Add new patch number below this line */
+ /**/
+     276,
  /**/

-- 
User:       I'm having problems with my text editor.
Help desk:  Which editor are you using?
User:       I don't know, but it's version VI (pronounced: 6).
Help desk:  Oh, then you should upgrade to version VIM (pronounced: 994).

 /// 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    ///