home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.4 / 7.4.432 < prev    next >
Encoding:
Internet Message Format  |  2014-09-09  |  3.0 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.432
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.4.432
  11. Problem:    When the startup code expands command line arguments, setting
  12.         'encoding' will not properly convert the arguments.
  13. Solution:   Call get_cmd_argsW() early in main(). (Yasuhiro Matsumoto)
  14. Files:        src/os_win32.c, src/main.c, src/os_mswin.c
  15.  
  16.  
  17. *** ../vim-7.4.431/src/os_win32.c    2014-08-29 17:45:28.066467800 +0200
  18. --- src/os_win32.c    2014-09-09 12:14:15.768500395 +0200
  19. ***************
  20. *** 6461,6466 ****
  21. --- 6461,6467 ----
  22.       int        argc = 0;
  23.       int        i;
  24.   
  25. +     free_cmd_argsW();
  26.       ArglistW = CommandLineToArgvW(GetCommandLineW(), &nArgsW);
  27.       if (ArglistW != NULL)
  28.       {
  29. ***************
  30. *** 6493,6499 ****
  31. --- 6494,6504 ----
  32.       global_argc = argc;
  33.       global_argv = argv;
  34.       if (argc > 0)
  35. +     {
  36. +     if (used_file_indexes != NULL)
  37. +         free(used_file_indexes);
  38.       used_file_indexes = malloc(argc * sizeof(int));
  39. +     }
  40.   
  41.       if (argvp != NULL)
  42.       *argvp = argv;
  43. *** ../vim-7.4.431/src/main.c    2014-08-10 13:34:59.056785459 +0200
  44. --- src/main.c    2014-09-09 12:16:09.016500642 +0200
  45. ***************
  46. *** 178,183 ****
  47. --- 178,191 ----
  48.        */
  49.       mch_early_init();
  50.   
  51. + #if defined(WIN32) && defined(FEAT_MBYTE)
  52. +     /*
  53. +      * MingW expands command line arguments, which confuses our code to
  54. +      * convert when 'encoding' changes.  Get the unexpanded arguments.
  55. +      */
  56. +     argc = get_cmd_argsW(&argv);
  57. + #endif
  58.       /* Many variables are in "params" so that we can pass them to invoked
  59.        * functions without a lot of arguments.  "argc" and "argv" are also
  60.        * copied, so that they can be changed. */
  61. ***************
  62. *** 1496,1501 ****
  63. --- 1504,1512 ----
  64.       if (garbage_collect_at_exit)
  65.       garbage_collect();
  66.   #endif
  67. + #if defined(WIN32) && defined(FEAT_MBYTE)
  68. +     free_cmd_argsW();
  69. + #endif
  70.   
  71.       mch_exit(exitval);
  72.   }
  73. *** ../vim-7.4.431/src/os_mswin.c    2014-03-19 12:37:18.537826062 +0100
  74. --- src/os_mswin.c    2014-09-09 12:17:25.696500810 +0200
  75. ***************
  76. *** 277,286 ****
  77.       AnsiUpperBuff(toupper_tab, 256);
  78.       AnsiLowerBuff(tolower_tab, 256);
  79.   #endif
  80. - #if defined(FEAT_MBYTE) && !defined(FEAT_GUI)
  81. -     (void)get_cmd_argsW(NULL);
  82. - #endif
  83.   }
  84.   
  85.   
  86. --- 277,282 ----
  87. *** ../vim-7.4.431/src/version.c    2014-09-09 12:21:57.716501404 +0200
  88. --- src/version.c    2014-09-09 12:24:38.440501755 +0200
  89. ***************
  90. *** 743,744 ****
  91. --- 743,746 ----
  92.   {   /* Add new patch number below this line */
  93. + /**/
  94. +     432,
  95.   /**/
  96.  
  97. -- 
  98. hundred-and-one symptoms of being an internet addict:
  99. 106. When told to "go to your room" you inform your parents that you
  100.      can't...because you were kicked out and banned.
  101.  
  102.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  103. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  104. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  105.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  106.