Commits

Anonymous committed 37a54a8

updated for version 7.3.276
Problem: GvimExt sets $LANG in the wrong way.
Solution: Save the environment and use it for gvim. (Yasuhiro Matsumoto)

  • Participants
  • Parent commits 166af06
  • Tags v7-3-276

Comments (0)

Files changed (2)

File src/GvimExt/gvimext.cpp

 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;
 inc_cRefThisDLL()
 {
 #ifdef FEAT_GETTEXT
-    if (g_cRefThisDll == 0)
+    if (g_cRefThisDll == 0) {
 	dyn_gettext_load();
+	oldenv = GetEnvironmentStringsW();
+    }
 #endif
     InterlockedIncrement((LPLONG)&g_cRefThisDll);
 }
 dec_cRefThisDLL()
 {
 #ifdef FEAT_GETTEXT
-    if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0)
+    if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) {
 	dyn_gettext_free();
+	if (oldenv != NULL) {
+	    FreeEnvironmentStringsW(oldenv);
+	    oldenv = NULL;
+	}
+    }
 #else
     InterlockedDecrement((LPLONG)&g_cRefThisDll);
 #endif
 			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.
+			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.
 		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.
+		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.

File src/version.c

 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    276,
+/**/
     275,
 /**/
     274,