[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: Sun, 06 May 2012 19:26:46 +0300

> Date: Sat, 05 May 2012 23:22:13 -0700
> From: Paul Eggert <address@hidden>
> CC: address@hidden, address@hidden
> 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 don't understand.  MinGW doesn't have a Posix shell, it is a native
Windows environment.  So a MinGW program running on Windows does not
need to cater to Posix shells more than a program running on a Posix
platform should cater to a Windows shell.  What use case did you have
in mind?

If there are some hypothetical use cases where such a mix makes sense,
they must be so rare that such a program should use the custom quoting
style, or simply not use gnulib for the quoting.

> 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.

That doesn't sound right.  popen and friends don't know enough about
the context to DTRT with quoting.  How would they know which style of
quoting is expected from them?

reply via email to

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