Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mattn
Copy link
Member

@mattn mattn commented Aug 5, 2017

If defined FEAT_MBYTE and WIN32 both, command-line arguments are parsed twice.

C:\temp>vim `notepad`

notepad appear twice. I'm not sure well, but this patch seems working good.

@mattn
Copy link
Member Author

mattn commented Aug 5, 2017

If defined FEAT_MBYTE and WIN32 both, common_init(), mb_init() are called. Then fix_arg_enc() call alist_expand().

@mattn
Copy link
Member Author

mattn commented Aug 5, 2017

I found another issue.

vim "`cmd /c echo *`"

This run command cmd \c echo *. But I think this is an another issue (which should be fixed).

@mattn
Copy link
Member Author

mattn commented Aug 5, 2017

I think this calling of slash_adjust is early doing here.

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index c61cd2e95..3bd02c7e1 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8165,9 +8165,6 @@ alist_add(
 {
     if (fname == NULL)		/* don't add NULL file names */
 	return;
-#ifdef BACKSLASH_IN_FILENAME
-    slash_adjust(fname);
-#endif
     AARGLIST(al)[al->al_ga.ga_len].ae_fname = fname;
     if (set_fnum > 0)
 	AARGLIST(al)[al->al_ga.ga_len].ae_fnum =

@mattn
Copy link
Member Author

mattn commented Aug 5, 2017

If applying both patches:

vim "`echo os_win32.c`"

This works fine now.

@mattn
Copy link
Member Author

mattn commented Aug 5, 2017

This patch still have issue. For example, if not set enc=utf-8 or other encoding, arguments are not expanded.

@mattn mattn force-pushed the fix-double-expand-args branch 3 times, most recently from 04e0358 to 4628196 Compare August 5, 2017 11:05
@mattn mattn force-pushed the fix-double-expand-args branch from 4628196 to 4bf6e44 Compare August 5, 2017 11:24
@mattn
Copy link
Member Author

mattn commented Aug 5, 2017

I once close this because this is not easy to fix. I'll make PR again.

@mattn mattn closed this Aug 5, 2017
@codecov-io
Copy link

codecov-io commented Aug 5, 2017

Codecov Report

Merging #1938 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1938      +/-   ##
==========================================
+ Coverage   75.11%   75.11%   +<.01%     
==========================================
  Files          76       76              
  Lines      125301   125301              
==========================================
+ Hits        94114    94116       +2     
+ Misses      31187    31185       -2
Impacted Files Coverage Δ
src/main.c 55.36% <ø> (ø) ⬆️
src/ex_docmd.c 74.79% <ø> (ø) ⬆️
src/window.c 81.46% <0%> (-0.07%) ⬇️
src/os_unix.c 57.01% <0%> (-0.05%) ⬇️
src/channel.c 83.92% <0%> (ø) ⬆️
src/gui_gtk_x11.c 47.6% <0%> (+0.1%) ⬆️
src/if_xcmdsrv.c 86.29% <0%> (+0.18%) ⬆️
src/version.c 80.3% <0%> (+1.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 07c043a...4bf6e44. Read the comment docs.

@mattn mattn deleted the fix-double-expand-args branch August 11, 2017 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants