diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-09-09 12:25:33 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-09-09 12:25:33 +0200 |
commit | 14993322b1bdcd507f439fbbf6dd3d051f777373 (patch) | |
tree | b8a8b6f28d4530eae40167b2bc79dbe6c2964a04 /src/main.c | |
parent | 120f4a878f61d78b9be34e3516aa4cdf0fc682d7 (diff) | |
download | vim-git-14993322b1bdcd507f439fbbf6dd3d051f777373.tar.gz |
updated for version 7.4.432v7.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)
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index 2fb2edcb5..70d291171 100644 --- a/src/main.c +++ b/src/main.c @@ -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); } |