1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: GvimExt sets $LANG in the wrong way.
12 Solution: Save the environment and use it for gvim. (Yasuhiro Matsumoto)
13 Files: src/GvimExt/gvimext.cpp
16 *** ../vim-7.3.275/src/GvimExt/gvimext.cpp 2011-07-20 17:27:17.000000000 +0200
17 --- src/GvimExt/gvimext.cpp 2011-08-10 16:25:32.000000000 +0200
21 static int dyn_libintl_init(char *dir);
22 static void dyn_libintl_end(void);
24 + static wchar_t *oldenv = NULL;
25 static HINSTANCE hLibintlDLL = 0;
26 static char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
27 static char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain;
33 ! if (g_cRefThisDll == 0)
36 InterlockedIncrement((LPLONG)&g_cRefThisDll);
42 ! if (g_cRefThisDll == 0) {
44 + oldenv = GetEnvironmentStringsW();
47 InterlockedIncrement((LPLONG)&g_cRefThisDll);
54 ! if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0)
57 InterlockedDecrement((LPLONG)&g_cRefThisDll);
63 ! if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) {
65 + if (oldenv != NULL) {
66 + FreeEnvironmentStringsW(oldenv);
71 InterlockedDecrement((LPLONG)&g_cRefThisDll);
75 NULL, // Process handle not inheritable.
76 NULL, // Thread handle not inheritable.
77 FALSE, // Set handle inheritance to FALSE.
78 ! 0, // No creation flags.
79 ! NULL, // Use parent's environment block.
80 NULL, // Use parent's starting directory.
81 &si, // Pointer to STARTUPINFO structure.
82 &pi) // Pointer to PROCESS_INFORMATION structure.
84 NULL, // Process handle not inheritable.
85 NULL, // Thread handle not inheritable.
86 FALSE, // Set handle inheritance to FALSE.
87 ! oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT,
88 ! oldenv, // Use unmodified environment block.
89 NULL, // Use parent's starting directory.
90 &si, // Pointer to STARTUPINFO structure.
91 &pi) // Pointer to PROCESS_INFORMATION structure.
94 NULL, // Process handle not inheritable.
95 NULL, // Thread handle not inheritable.
96 FALSE, // Set handle inheritance to FALSE.
97 ! 0, // No creation flags.
98 ! NULL, // Use parent's environment block.
99 NULL, // Use parent's starting directory.
100 &si, // Pointer to STARTUPINFO structure.
101 &pi) // Pointer to PROCESS_INFORMATION structure.
103 NULL, // Process handle not inheritable.
104 NULL, // Thread handle not inheritable.
105 FALSE, // Set handle inheritance to FALSE.
106 ! oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT,
107 ! oldenv, // Use unmodified environment block.
108 NULL, // Use parent's starting directory.
109 &si, // Pointer to STARTUPINFO structure.
110 &pi) // Pointer to PROCESS_INFORMATION structure.
111 *** ../vim-7.3.275/src/version.c 2011-08-10 15:56:24.000000000 +0200
112 --- src/version.c 2011-08-10 16:28:42.000000000 +0200
116 { /* Add new patch number below this line */
122 User: I'm having problems with my text editor.
123 Help desk: Which editor are you using?
124 User: I don't know, but it's version VI (pronounced: 6).
125 Help desk: Oh, then you should upgrade to version VIM (pronounced: 994).
127 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
128 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
129 \\\ an exciting new programming language -- http://www.Zimbu.org ///
130 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///