diff src/os_win32.c @ 6193:59cd2b16f718 v7.4.432

updated for version 7.4.432 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)
author Bram Moolenaar <bram@vim.org>
date Tue, 09 Sep 2014 12:25:33 +0200
parents 1fe61f6d5207
children 7816c24ff890
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -6461,6 +6461,7 @@ get_cmd_argsW(char ***argvp)
     int		argc = 0;
     int		i;
 
+    free_cmd_argsW();
     ArglistW = CommandLineToArgvW(GetCommandLineW(), &nArgsW);
     if (ArglistW != NULL)
     {
@@ -6493,7 +6494,11 @@ get_cmd_argsW(char ***argvp)
     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;