Re: quotearg.c's shell_quoting_style and MinGW
Bruno Haible <[email protected]>
| Newsgroups | gmane.comp.lib.gnulib.bugs,gmane.comp.gnu.utils.bugs |
|---|---|
| Message-ID | <89099532.dCia1O68gm@linuix> |
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')?
In other words, please state a "How to reproduce" recipe.
> +/* 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?
> + 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. See gnulib/README for a way
to avoid tabs.
Bruno