Problem: When the startup code expands command line arguments, setting
'encoding' will not properly convert the arguments.
Solution: Call get_cmd_argsW() early in main(). (Yasuhiro Matsumoto)
*/
mch_early_init();
+#if defined(WIN32) && defined(FEAT_MBYTE)
+ /*
+ * MingW expands command line arguments, which confuses our code to
+ * convert when 'encoding' changes. Get the unexpanded arguments.
+ */
+ argc = get_cmd_argsW(&argv);
+#endif
+
/* Many variables are in "params" so that we can pass them to invoked
* functions without a lot of arguments. "argc" and "argv" are also
* copied, so that they can be changed. */
if (garbage_collect_at_exit)
garbage_collect();
#endif
+#if defined(WIN32) && defined(FEAT_MBYTE)
+ free_cmd_argsW();
+#endif
mch_exit(exitval);
}
AnsiUpperBuff(toupper_tab, 256);
AnsiLowerBuff(tolower_tab, 256);
#endif
-
-#if defined(FEAT_MBYTE) && !defined(FEAT_GUI)
- (void)get_cmd_argsW(NULL);
-#endif
}
int argc = 0;
int i;
+ free_cmd_argsW();
ArglistW = CommandLineToArgvW(GetCommandLineW(), &nArgsW);
if (ArglistW != NULL)
{
global_argc = argc;
global_argv = argv;
if (argc > 0)
+ {
+ if (used_file_indexes != NULL)
+ free(used_file_indexes);
used_file_indexes = malloc(argc * sizeof(int));
+ }
if (argvp != NULL)
*argvp = argv;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 432,
/**/
431,
/**/