bug-gnulib
[Top][All Lists]
Advanced

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

Re: quotearg.c's shell_quoting_style and MinGW


From: Paul Eggert
Subject: Re: quotearg.c's shell_quoting_style and MinGW
Date: Sat, 05 May 2012 23:22:13 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 05/05/2012 09:54 AM, 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.

Unfortunately quotearg is used not just to quote
strings for the shell, but also to quote strings POSIX-shell-style
for stdout.  That is, in practice shell_quoting_style doesn't mean
"quote this safely for whatever shell the current system happens to
be using", it means "quote this safely for POSIX shell syntax".

I suggest instead  putting a wrapper around popen and system,
so that they translate quotes from the POSIX syntax to the
syntax expected by mingw.  That would fix the problem with diff,
and it would be a more-useful fix anyway, as it would catch
instances of this problem that can occur even when quotearg is
not used.  This wrapper would be at the gnulib level.



reply via email to

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