Re: quotearg.c's shell_quoting_style and MinGW
Eli Zaretskii <[email protected]>
| Newsgroups | gmane.comp.gnu.utils.bugs,gmane.comp.lib.gnulib.bugs |
|---|---|
| Message-ID | <[email protected]> |
> From: Bruno Haible <[email protected]> > Cc: [email protected] > 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.