patch 9.0.1313: some settings use the current codepage instead of 'encoding'
Problem: Some settings use the current codepage instead of 'encoding'.
Solution: Adjust how options are initialized. (Ken Takata, closes #11992)
diff --git a/src/misc1.c b/src/misc1.c
index d369f2a..c83b7ae 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -1311,6 +1311,32 @@
}
#endif
+#if defined(MSWIN) || defined(PROTO)
+/*
+ * Initilize $VIM and $VIMRUNTIME when 'enc' is updated.
+ */
+ void
+init_vimdir(void)
+{
+ int mustfree;
+ char_u *p;
+
+ mch_get_exe_name();
+
+ mustfree = FALSE;
+ didset_vim = FALSE;
+ p = vim_getenv((char_u *)"VIM", &mustfree);
+ if (mustfree)
+ vim_free(p);
+
+ mustfree = FALSE;
+ didset_vimruntime = FALSE;
+ p = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
+ if (mustfree)
+ vim_free(p);
+}
+#endif
+
/*
* Call expand_env() and store the result in an allocated string.
* This is not very memory efficient, this expects the result to be freed
@@ -1696,7 +1722,7 @@
* Vim's version of getenv().
* Special handling of $HOME, $VIM and $VIMRUNTIME.
* Also does ACP to 'enc' conversion for Win32.
- * "mustfree" is set to TRUE when returned is allocated, it must be
+ * "mustfree" is set to TRUE when the returned string is allocated. It must be
* initialized to FALSE by the caller.
*/
char_u *