Am 18.02.2012 18:14, schrieb Benjamin Fritz:
On Wed, Feb 15, 2012 at 10:54 PM, Bram Moolenaar wrote:
Please try the patch below. I currently do not have a Windows machine
to try this out.
I feel like an idiot, but I cannot get the patch to apply cleanly; and
importing into mq just says the p
On Wed, Feb 15, 2012 at 10:54 PM, Bram Moolenaar wrote:
> Please try the patch below. I currently do not have a Windows machine
> to try this out.
I feel like an idiot, but I cannot get the patch to apply cleanly; and
importing into mq just says the patch is empty!
Can someone see what I'm doin
Am 17.02.2012 13:43, schrieb Jürgen Krämer:
works.
Thanks :-)
--
Andy
--
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
Hi,
Andy Wokula wrote:
> Am 15.02.2012 19:36, schrieb Andy Wokula:
>> Am 15.02.2012 17:22, schrieb Ben Fritz:
New settings:
shellcmdflag: /c
shellxquote: (
and escape special chars with `^'.
>>>
>>> So you're saying, we must escape all special characters, INCLUDING
>>> QUOTES,
On 17-Feb-2012 13:34, Andy Wokula wrote:
> Am 15.02.2012 19:36, schrieb Andy Wokula:
>> Am 15.02.2012 17:22, schrieb Ben Fritz:
New settings:
shellcmdflag: /c
shellxquote: (
and escape special chars with `^'.
>>>
>>> So you're saying, we must escape all special characters, INCLU
Am 15.02.2012 19:36, schrieb Andy Wokula:
Am 15.02.2012 17:22, schrieb Ben Fritz:
New settings:
shellcmdflag: /c
shellxquote: (
and escape special chars with `^'.
So you're saying, we must escape all special characters, INCLUDING
QUOTES, and surround in parentheses?
Yes, including quotes!
P.S.:
> # protect against expansion of %FOO% by turning it into %""FOO%:
>
> if (ch is '%' and the following character is not double_quote or
> backslash)
> quoted += double_quote + double_quote
only insert the "" if there actually *is* a following character in cmd.
R
Hi!
As a further data point: I have found the following algorithm for
Windows shell quoting quite reliable under the following conditions:
* Windows 2000, Windows XP, or Windows 7
* the assembled command is executed using "system"
* both parent and child programs compiled by MinGW
I tested this
On Thu, Feb 16, 2012 at 4:52 PM, John Beckett wrote:
> Edwin Steiner wrote:
> > I found it most reliable for testing to write a simple C
> > program that prints its argv[] array.
>
> I did that a few years ago, and in case anyone is interested,
> here is what I used.
I fought with all this shellq
Edwin Steiner wrote:
> I found it most reliable for testing to write a simple C
> program that prints its argv[] array.
I did that a few years ago, and in case anyone is interested,
here is what I used.
/* Echo arguments in one line.
* John Beckett 2007/05/25
* This is to see what is passed to
Hi!
> Bram Moolenaar wrote:
> > Andy Wokula wrote:
> >
> > > Am 14.02.2012 13:20, schrieb mattn:
> > > > cmd /c "(echo a& echo b)"
> > >
> > > Ok!
One caveat that I learned the hard way:
Do not trust "echo" too much when testing shell quoting on Windows!
On Windows the separation of the comm
Am 16.02.2012 05:54, schrieb Bram Moolenaar:
Please try the patch below. I currently do not have a Windows machine
to try this out.
I had success with applying the patch.
:set shcf? sxq?
shellcmdflag=/s /c
shellxquote="(
:!"my cat.exe" "file with spaces.txt"
-> cmd.exe /s /c "("my cat.e
Am 16.02.2012 22:05, schrieb Bram Moolenaar:
Andy Wokula wrote:
Am 16.02.2012 05:54, schrieb Bram Moolenaar:
Ben Fritz wrote:
I think we should do the auto-escaping, with shellxquote=(, and
additionally add a help note by :! and system() that "According to
the Microsoft documentation for cmd
Andy Wokula wrote:
> Am 16.02.2012 05:54, schrieb Bram Moolenaar:
> > Ben Fritz wrote:
> >
> >> I think we should do the auto-escaping, with shellxquote=(, and
> >> additionally add a help note by :! and system() that "According to
> >> the Microsoft documentation for cmd.exe, you either need to
I wrote:
> Ben Fritz wrote:
>
> > I think we should do the auto-escaping, with shellxquote=(, and
> > additionally add a help note by :! and system() that "According to the
> > Microsoft documentation for cmd.exe, you either need to escape (with a
> > ^ character) any of these characters appeari
Am 16.02.2012 05:54, schrieb Bram Moolenaar:
Ben Fritz wrote:
I think we should do the auto-escaping, with shellxquote=(, and
additionally add a help note by :! and system() that "According to
the Microsoft documentation for cmd.exe, you either need to escape
(with a ^ character) any of these c
Ben Fritz wrote:
> I think we should do the auto-escaping, with shellxquote=(, and
> additionally add a help note by :! and system() that "According to the
> Microsoft documentation for cmd.exe, you either need to escape (with a
> ^ character) any of these characters appearing literally in your
>
On Wed, Feb 15, 2012 at 1:10 PM, Benjamin Fritz wrote:
> Parentheses are still weird :-(
>
> C:\eclim-git\eclim>cmd /c echo abc)
> abc)
>
I just realized this one is invalid anyway, since MS says you need to
escape a literal ) and here the user does not
> C:\eclim-git\eclim>cmd /c (echo abc))
>
On Wed, Feb 15, 2012 at 12:36 PM, Andy Wokula wrote:
> Am 15.02.2012 17:22, schrieb Ben Fritz:
>
>>> New settings:
>>> shellcmdflag: /c
>>> shellxquote: (
>>> and escape special chars with `^'.
>>
>>
>> So you're saying, we must escape all special characters, INCLUDING
>> QUOTES, and sur
On Wed, Feb 15, 2012 at 12:36 PM, Andy Wokula wrote:
>> So you're saying, we must escape all special characters, INCLUDING
>> QUOTES, and surround in parentheses?
>
>
> Yes, including quotes!
>
>> That's...special.
>
>
> But solves all problems so far.
Yes, but that doesn't mean I need to like it
Am 15.02.2012 17:22, schrieb Ben Fritz:
New settings:
shellcmdflag: /c
shellxquote: (
and escape special chars with `^'.
So you're saying, we must escape all special characters, INCLUDING
QUOTES, and surround in parentheses?
Yes, including quotes!
That's...special.
But solves
On Feb 15, 8:11 am, Andy Wokula wrote:
>
> Doesn't work either for `('...`)':
> cmd /c (cat cm.txt > "c&m.txt")
>
> it creates `c&m.txt)'.
>
> But `('...`)' works when inner special chars are escaped:
> cmd /c (cat cm.txt ^> ^"c^&m.txt^")
> cmd /c (echo a ^& echo b)
> cmd /c
Am 15.02.2012 14:38, schrieb RoDo:
You can execute
cmd /c ("my editor.exe" "my filea.txt" a ^& dir) as well.
Surprise -- it indeed executes `dir'.
This suggests that special characters within `(' ... `)' should be
escaped with `^'.
The following works as well:
cmd /c (^"my editor.exe^" ^
2 pm, mattn wrote:
> > Patch:
> > shellcmdflag: /c (not sure if `/s /c' would make a difference,
> > I'd expect `/c' to always remove outer quotes)
> > shellxquote: "(
> > or maybe:
> > shellxquote: "(,)" (new syntax!)
>
> >
Am 15.02.2012 13:42, schrieb mattn:
Patch:
shellcmdflag: /c (not sure if `/s /c' would make a difference,
I'd expect `/c' to always remove outer quotes)
shellxquote: "(
or maybe:
shellxquote: "(,)" (new syntax!)
Yeah, this works now (also did without patch 7.
> Patch:
> shellcmdflag: /c (not sure if `/s /c' would make a difference,
> I'd expect `/c' to always remove outer quotes)
> shellxquote: "(
> or maybe:
> shellxquote: "(,)" (new syntax!)
>
> Yeah, this works now (also did without patc
ut: two lines, `a' and `b)'
Problem: echo does not ignore the trailing `)'
Solution: enclose cmd's argument in `"('...`)"'
(I have no idea why this works)
Patch:
shellcmdflag: /c(not sure if `/s /c' would make a difference,
Please Please Please note that patch 7.3.443 is breaking original behavior.
And just now many vim plugins does not work correctly without avoiding to
this change.
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replyi
Make every command work would be very complicated.
Vim need to parse the command and understand it correctly, then escape
the special chars.
Let's give it back to user and cmd.exe. XD
On Feb 15, 11:06 am, Bram Moolenaar wrote:
> Ben Fritz wrote:
> > On Feb 14, 4:31 am, RoDo wrote:
> > > echo sy
> Ehm, thus 'shellxquote' should be "(, and we should turn that into )"
> for the tail? It's possible, but I wonder where it breaks now.
Yes, I wonder:
* What is a problem
* Why 7.3.443 is needed.
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below
Ben Fritz wrote:
> On Feb 14, 4:31 am, RoDo wrote:
> > echo system('echo a & echo b') fail
> > should escape &
> > echo system('echo a ^& echo b') pass
> >
>
> It looks like most of the use cases pass when using the () patch for
> shellxquote, I like that option.
>
> Since there are still some
Rodo wrote:
> Good.
>
> small patch:
>
> --- misc2_org.c 2012-02-14 18:09:38 +0800
> +++ misc2.c 2012-02-14 17:51:54 +0800
> @@ -3230,7 +3230,13 @@
> {
> STRCPY(ncmd, p_sxq);
> STRCAT(ncmd, cmd);
> - STRCAT(ncmd, p_sxq);
> +
Andy Wokula wrote:
> Am 14.02.2012 13:20, schrieb mattn:
> > cmd /c "(echo a& echo b)"
>
> Ok!
Ehm, thus 'shellxquote' should be "(, and we should turn that into )"
for the tail? It's possible, but I wonder where it breaks now.
--
hundred-and-one symptoms of being an internet addict:
57. Yo
Sorry, my mistake.
Previous patch break shellxquote = \"
update:
--- os_win32_org.c 2012-02-14 21:18:54 +0800
+++ os_win32.c 2012-02-15 02:45:42 +0800
@@ -3909,6 +3909,7 @@
if (newcmd != NULL)
{
char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd);
+ cmdbase
On Feb 13, 10:04 pm, Bram Moolenaar wrote:
> Ben Fritz wrote:
> > Ugh, apparently so. I thought the documentation of cmd.exe was clear
> > enough to prevent this sort of thing, but that's apparently irrelevant
> > because cmd.exe doesn't follow it.
>
> Never trust Microsoft documentation, always
On Feb 14, 4:31 am, RoDo wrote:
> echo system('echo a & echo b') fail
> should escape &
> echo system('echo a ^& echo b') pass
>
It looks like most of the use cases pass when using the () patch for
shellxquote, I like that option.
Since there are still some failures when using an unescaped & m
patch update
add a os_win32 patch
--- os_win32_org.c 2012-02-14 21:18:54 +0800
+++ os_win32.c 2012-02-14 21:24:27 +0800
@@ -3909,6 +3909,7 @@
if (newcmd != NULL)
{
char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd);
+ cmdbase = (*cmd == '(' ? cmd + 1 : cmd)
Am 14.02.2012 13:20, schrieb mattn:
cmd /c "(echo a& echo b)"
Ok!
--
Andy
--
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
cmd /c "(echo a & echo b)"
--
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
On 14/02/2012 11:10, Andy Wokula wrote:
Am 14.02.2012 11:31, schrieb RoDo:
echo system('echo a & echo b') fail
should escape &
echo system('echo a ^& echo b') pass
omg:
C:\> echo a & echo b
a
b
C:\> cmd /c ( echo a & echo b )
b )
Looks like a bug with cmd.exe .
I guess it's specific to echo
Am 14.02.2012 11:31, schrieb RoDo:
echo system('echo a & echo b') fail
should escape &
echo system('echo a ^& echo b') pass
omg:
C:\> echo a & echo b
a
b
C:\> cmd /c ( echo a & echo b )
b )
Looks like a bug with cmd.exe .
I guess it's specific to echo .
And it's quite an esoteric command li
echo system('echo a & echo b') fail
should escape &
echo system('echo a ^& echo b') pass
On Feb 14, 6:21 pm, RoDo wrote:
> Good.
>
> small patch:
>
> --- misc2_org.c 2012-02-14 18:09:38 +0800
> +++ misc2.c 2012-02-14 17:51:54 +0800
> @@ -3230,7 +3230,13 @@
> {
> ST
Good.
small patch:
--- misc2_org.c 2012-02-14 18:09:38 +0800
+++ misc2.c 2012-02-14 17:51:54 +0800
@@ -3230,7 +3230,13 @@
{
STRCPY(ncmd, p_sxq);
STRCAT(ncmd, cmd);
- STRCAT(ncmd, p_sxq);
+if (STRCMP(p_sxq, "(") == 0)
+
Or we can escape " to """. cmd.exe treat """ as quoted double quote. So
#include
int
main(int argc, char* argv[]) {
int n;
for (n = 0; n < argc; n++) {
printf("[%s]\n", argv[n]);
}
return 0;
}
C:\>arg
[arg]
C:\>arg foo
[arg]
[foo]
C:\>arg "foo"
[arg]
[foo]
C:\>arg ""foo
Ben Fritz wrote:
> On Feb 13, 12:14 pm, Andy Wokula wrote:
> > Am 12.02.2012 23:23, schrieb Bram Moolenaar:
> >
> >
> >
> > > Patch 7.3.443
> > > Problem: MS-Windows: 'shcf' and 'shellxquote' defaults are not very
> &g
On Feb 13, 12:14 pm, Andy Wokula wrote:
> Am 12.02.2012 23:23, schrieb Bram Moolenaar:
>
>
>
> > Patch 7.3.443
> > Problem: MS-Windows: 'shcf' and 'shellxquote' defaults are not very good.
> > Solution: Make a better guess when '
Am 13.02.2012 19:14, schrieb Andy Wokula:
C:\>("C:\Program Files\abc.exe" "some arg with spaces")
er, I meant
C:\> cmd /c ("C:\Program Files\abc.exe" "some arg with spaces")
--
Andy
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you a
Am 12.02.2012 23:23, schrieb Bram Moolenaar:
Patch 7.3.443
Problem:MS-Windows: 'shcf' and 'shellxquote' defaults are not very good.
Solution: Make a better guess when 'shell' is set to "cmd.exe". (Ben Fritz)
Files: src/option.c, runtime/doc/op
You are right.
I total forget about this.
I have a copy from vimrc_example which diffexpr set to MyDiff
function.
Remove it solve the problem. Thank you.
It's time to clean my _vimrc.
It's big and totally mess up.
On Feb 14, 12:33 am, Ben Fritz wrote:
> On Feb 13, 10:23 am, RoDo wrote:
>
> > Nev
On Feb 13, 10:23 am, RoDo wrote:
> Never know ^ before.
> But pipe work without ^.
> It's weird.
> Also set shellxquote=\" breaks gvim -d.
> The diff mode command should be changed too.
>
I've been using these values for shellxquote and shellcmdflag for a
long time now, and use vimdiff all the
Never know ^ before.
But pipe work without ^.
It's weird.
Also set shellxquote=\" breaks gvim -d.
The diff mode command should be changed too.
On Feb 14, 12:14 am, Ben Fritz wrote:
> On Feb 13, 10:01 am, Ben Fritz wrote:
>
>
>
> > Maybe Vim can automatically add this ^ character somehow? This s
On Feb 13, 10:01 am, Ben Fritz wrote:
>
> Maybe Vim can automatically add this ^ character somehow? This seems
> like a job for shellescape().
>
> As far as the patch is concerned, I still think it the right thing to
> do. But we must ask, which is more likely to occur in a call to an
> external
On Feb 13, 9:41 am, Ben Fritz wrote:
>
> 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 ar
On Feb 12, 8:34 pm, mattn wrote:
> Easy way to reproduce. Check followings.
>
> :set shellxquote&
> :echo system('dir "&"')
>
> :set shellxquote=
> :echo system('dir "&"')
>
> This should be "File Nout Found".
For me, without the patch, but setting the options as done in the
patch, i.e.:
gvim
On Feb 12, 7:27 pm, mattn 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 wa
Am 13.02.2012 02:27, schrieb mattn:
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:
set noshelltemp
get "File Not Found"
So this patch solve the problem only if you use pipe.
On 2月13日, 上午10时34分, mattn wrote:
> Easy way to reproduce. Check followings.
>
> :set shellxquote&
> :echo system('dir "&"')
>
> :set shellxquote=
> :echo system('dir "&"')
>
> This should be "File Nout Fou
> This is the opposite of what the patch was fixing.
> What system is this on?
Windows XP. using cmd.exe
> What were the option values before and after the patch?
I don't set anything. using defaults.
> Does it work OK without the /s argument?
No.
--
You received this message from the "vi
Yasuhiro Matsumoto 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 ex
Easy way to reproduce. Check followings.
:set shellxquote&
:echo system('dir "&"')
:set shellxquote=
:echo system('dir "&"')
This should be "File Nout Found".
--
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
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 -hma
Patch 7.3.443
Problem:MS-Windows: 'shcf' and 'shellxquote' defaults are not very good.
Solution: Make a better guess when 'shell' is set to "cmd.exe". (Ben Fritz)
Files: src/option.c, runtime/doc/options.txt
*** ../vim-7.3.442/src/option.c 201
62 matches
Mail list logo