On Feb 12, 7:27 pm, mattn <[email protected]> wrote:
> Sorry for delay for my checking this patch.
>
> This break many behaviors to call external program on windows.
> For example:
>
> Since 7.3.433:
>
> let command = 'openssl dgst -binary -sha1 -hmac "A&B" < c:/temp/foo.tmp'
> let ret = system(command)
>
> This was expanded to:
>
> cmd /c openssl dgst -binary -sha1 -hmac "A&B" < c:/temp/foo.tmp
>
> But After 7.3.433:
>
> let command = 'openssl dgst -binary -sha1 -hmac "A&B" < c:/temp/foo.tmp'
> let ret = system(command)
>
> This will be expanded to:
>
> cmd /s /c "openssl dgst -binary -sha1 -hmac "A&B" < c:/temp/foo.tmp"
>
This is actually correct, it just looks weird. The /s /c is supposed
to strip off the first and last " character before expanding, so the
command which actually gets executed is still:
openssl dgst -binary -sha1 -hmac "A&B" < c:/temp/foo.tmp
The patch was intended to fix things like this:
"C:\Program Files\abc.exe" "some arg with spaces"
which the default cmd.exe /c will treat as:
C:\Program Files\abc.exe" "some arg with spaces
which is obviously wrong.
The default values in the patch first turn it into:
""C:\Program Files\abc.exe" "some arg with spaces""
which cmd.exe /s /c treats as:
"C:\Program Files\abc.exe" "some arg with spaces"
as intended.
See cmd.exe /?
If /C or /K is specified, then the remainder of the command line after
the switch is processed as a command line, where the following logic
is
used to process quote (") characters:
1. If all of the following conditions are met, then quote
characters
on the command line are preserved:
- no /S switch
- exactly two quote characters
- no special characters between the two quote characters,
where special is one of: &<>()@^|
- there are one or more whitespace characters between the
the two quote characters
- the string between the two quote characters is the name
of an executable file.
2. Otherwise, old behavior is to see if the first character is
a quote character and if so, strip the leading character and
remove the last quote character on the command line,
preserving
any text after the last quote character.
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php