[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quotearg.c's shell_quoting_style and MinGW

From: Bruno Haible
Subject: Re: quotearg.c's shell_quoting_style and MinGW
Date: Sun, 06 May 2012 19:41:39 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

Eli Zaretskii wrote:
> The rare situation where it doesn't (described by "cmd /?")

Rare or not - the text that you refer to mentions that the following
characters need to be quoted as well when passing through cmd.exe:
And they forgot to mention at least % which also has an interpretation.

That's why I'm saying that when passing through cmd.exe you need a
more complex quoting.

> > In particular, there is another use of shell_quote() in src/diff.c,
> > function option_list(). It is used here:
> > 
> > $ mkdir foo ; echo Hi > foo/text
> > $ mkdir gaz ; echo Hello > gaz/text
> > $ diff -r -x foo\ bar foo gaz
> > diff -r -x 'foo bar' foo/text gaz/text
> > 1c1
> > < Hi
> > ---
> > > Hello
> > 
> > Your proposed patch would lead to a different 'diff' output on native 
> > Windows.
> > Which is obviously undesirable.
> A command line such as
>   diff -r -x foo\ bar foo gaz
> is impossible on MS-Windows

I was assuming a Cygwin or MSYS shell with diff.exe being a native Windows

But you are splitting hairs. The main points is that
  1) We don't want to change the default output of 'diff' on Unix.
  2) We don't want 'diff' to produce different output on Windows than on
     Unix (modulo end-of-line convention),
  3) Your patch would not only have had an effect on the popen() and
     system() invocations but also on the 'diff' output.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]