[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: |
Eli Zaretskii |
Subject: |
Re: quotearg.c's shell_quoting_style and MinGW |
Date: |
Sat, 05 May 2012 22:14:04 +0300 |
> From: Bruno Haible <address@hidden>
> Cc: address@hidden
> Date: Sat, 05 May 2012 20:08:45 +0200
>
> Eli Zaretskii wrote:
> > When quoting a shell command argument (using shell_quoting_style or
> > shell_always_quoting_style), quotearg.c uses the '..' style of
> > quoting. This doesn't work for MinGW, which supports only the ".."
> > style. This causes, e.g., diff3 to fail for file names with embedded
> > whitespace or other special characters, when compiled for MinGW.
>
> What exactly did not work? Does 'diff3' give an error message that
> it cannot find the file? Does a unit test from the diffutils package
> not work? Does 'diff3' produce an output that is incompatible with
> other tools (such as 'patch' or 'emacs')?
Diff3 failed with an error message.
> In other words, please state a "How to reproduce" recipe.
Here:
D:\gnu\diffutils-3.2\src>.\diff3 ../../diffutils-2.8.7/src/system.h system.h
"sys tem.$h$"
diff: extra operand `tem.$h$''
diff: Try `diff --help' for more information.
D:\gnu\diffutils-3.2\src/./diff3.exe: subsidiary program `diff' failed (exit
status 2)
> > +/* The (system-dependent) shell quoting character. */
> > +#ifdef __MINGW32__
>
> This #ifdef is true for mingw but false for native Windows executables
> built with MSVC. Is that what you intended?
I only tested the code with MinGW. But I don't mind using
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
instead, if you are okay with assuming it will work with MSVC.
> > + if (quoting_style == shell_always_quoting_style)
> > + {
> > + if (elide_outer_quotes)
> > + goto force_outer_quoting_style;
> > + if (c == '"' && c == shell_quoting_char)
> > + {
> > + STORE ('"');
> > + STORE ('\\');
> > + STORE ('"');
> > + }
> > + }
>
> No tabs in gnulib source code, please.
Sorry, I didn't know that. Do you need me to submit TAB-less diffs?
Thanks.
- quotearg.c's shell_quoting_style and MinGW, Eli Zaretskii, 2012/05/05
- Re: quotearg.c's shell_quoting_style and MinGW, Bruno Haible, 2012/05/05
- Re: quotearg.c's shell_quoting_style and MinGW,
Eli Zaretskii <=
- Re: quotearg.c's shell_quoting_style and MinGW, Bruno Haible, 2012/05/06
- Re: quotearg.c's shell_quoting_style and MinGW, Paul Eggert, 2012/05/06
- Re: quotearg.c's shell_quoting_style and MinGW, Bruno Haible, 2012/05/06
- Re: quotearg.c's shell_quoting_style and MinGW, Paul Eggert, 2012/05/06
- Re: quotearg.c's shell_quoting_style and MinGW, Bruno Haible, 2012/05/06
- Re: quotearg.c's shell_quoting_style and MinGW, Eli Zaretskii, 2012/05/06
- Re: quotearg.c's shell_quoting_style and MinGW, Bruno Haible, 2012/05/06
- Re: quotearg.c's shell_quoting_style and MinGW, Eli Zaretskii, 2012/05/06
- Re: quotearg.c's shell_quoting_style and MinGW, Bruno Haible, 2012/05/06
- Re: quotearg.c's shell_quoting_style and MinGW, John Cowan, 2012/05/06