]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.432 v7.4.432
authorBram Moolenaar <Bram@vim.org>
Tue, 9 Sep 2014 10:25:33 +0000 (12:25 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 9 Sep 2014 10:25:33 +0000 (12:25 +0200)
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)

src/main.c
src/os_mswin.c
src/os_win32.c
src/version.c

index 2fb2edcb59d2a19c449d78bee396251273126b0c..70d291171f44bda8544ca32ed2b5e1adf8ad5b7f 100644 (file)
@@ -178,6 +178,14 @@ main
      */
     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. */
@@ -1496,6 +1504,9 @@ getout(exitval)
     if (garbage_collect_at_exit)
        garbage_collect();
 #endif
+#if defined(WIN32) && defined(FEAT_MBYTE)
+    free_cmd_argsW();
+#endif
 
     mch_exit(exitval);
 }
index 871afad9d2f296ae59eb419bf0c7f21e27510df2..b5786800e400305f1218ca9d0f88b2b34c86a2cf 100644 (file)
@@ -277,10 +277,6 @@ mch_early_init(void)
     AnsiUpperBuff(toupper_tab, 256);
     AnsiLowerBuff(tolower_tab, 256);
 #endif
-
-#if defined(FEAT_MBYTE) && !defined(FEAT_GUI)
-    (void)get_cmd_argsW(NULL);
-#endif
 }
 
 
index dd5714158ce4d247f90ce33abf6fb0d3efbc6a64..7192c51a03c706189fc57343a90a91d9eafcc699 100644 (file)
@@ -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;
index 838c1d6079c8c32cf74c0fa8c0b6547b03d327a8..18ea863d844631e1e9adbebb6b66949ac2479839 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    432,
 /**/
     431,
 /**/