Re: gvimext replace lang for new gvim
Yasuhiro Matsumoto wrote: gvimext set $LANG for gettext. and This environment variable pass to new gvim. below is a patch for this problem. Thanks. This will fix issue no 11. http://code.google.com/p/vim/issues/detail?id=11 Can someone verify this works and doesn't cause new problems? -- hundred-and-one symptoms of being an internet addict: 186. You overstay in the office so you can have more time surfing the net. /// Bram Moolenaar -- b...@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/// -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
gvimext replace lang for new gvim
Hi. gvimext set $LANG for gettext. and This environment variable pass to new gvim. below is a patch for this problem. This will fix issue no 11. http://code.google.com/p/vim/issues/detail?id=11 -- diff -r c6f8f1957c66 src/GvimExt/gvimext.cpp --- a/src/GvimExt/gvimext.cpp Mon Jun 13 21:21:22 2011 +0200 +++ b/src/GvimExt/gvimext.cpp Thu Jun 16 14:28:35 2011 +0900 @@ -142,6 +142,7 @@ 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,8 +340,10 @@ inc_cRefThisDLL() { #ifdef FEAT_GETTEXT -if (g_cRefThisDll == 0) +if (g_cRefThisDll == 0) { dyn_gettext_load(); + oldenv = GetEnvironmentStringsW(); +} #endif InterlockedIncrement((LPLONG)g_cRefThisDll); } @@ -349,8 +352,11 @@ dec_cRefThisDLL() { #ifdef FEAT_GETTEXT -if (InterlockedDecrement((LPLONG)g_cRefThisDll) == 0) +if (InterlockedDecrement((LPLONG)g_cRefThisDll) == 0) { dyn_gettext_free(); + if (oldenv) +FreeEnvironmentStringsW(oldenv); +} #else InterlockedDecrement((LPLONG)g_cRefThisDll); #endif @@ -890,8 +896,8 @@ 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. + CREATE_UNICODE_ENVIRONMENT, // No creation flags. + oldenv, // Use parent's environment block. NULL, // Use parent's starting directory. si, // Pointer to STARTUPINFO structure. pi) // Pointer to PROCESS_INFORMATION structure. -- Thanks. - Yasuhiro Matsumoto -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
Re: gvimext replace lang for new gvim
Ooops, bits strange. Below is a better. diff -r c6f8f1957c66 src/GvimExt/gvimext.cpp --- a/src/GvimExt/gvimext.cpp Mon Jun 13 21:21:22 2011 +0200 +++ b/src/GvimExt/gvimext.cpp Thu Jun 16 14:33:28 2011 +0900 @@ -142,6 +142,7 @@ 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,8 +340,10 @@ inc_cRefThisDLL() { #ifdef FEAT_GETTEXT -if (g_cRefThisDll == 0) +if (g_cRefThisDll == 0) { dyn_gettext_load(); + oldenv = GetEnvironmentStringsW(); +} #endif InterlockedIncrement((LPLONG)g_cRefThisDll); } @@ -349,8 +352,11 @@ dec_cRefThisDLL() { #ifdef FEAT_GETTEXT -if (InterlockedDecrement((LPLONG)g_cRefThisDll) == 0) +if (InterlockedDecrement((LPLONG)g_cRefThisDll) == 0) { dyn_gettext_free(); + if (oldenv) +FreeEnvironmentStringsW(oldenv); +} #else InterlockedDecrement((LPLONG)g_cRefThisDll); #endif @@ -890,8 +896,9 @@ 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 ? CREATE_UNICODE_ENVIRONMENT : 0, + // No creation flags. + oldenv, // Use parent's environment block. NULL, // Use parent's starting directory. si, // Pointer to STARTUPINFO structure. pi) // Pointer to PROCESS_INFORMATION structure. -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php