Correct quoting for pkg-config on Windows

Dan Nicholson dbn.lists at
Fri Jan 25 08:44:32 PST 2013

Hi Niklas,

On Jan 4, 2013 5:36 AM, "Niklas Gürtler" <profclonk at> wrote:
> Dear readers,
> quoting of arguments to command line programs works different on Windows
> than on *nix, for example:
> When executing MinGW's gcc.exe from cmd.exe:
> Typed in cmd.exe        Gets transformed to
> "foo.exe"               foo.exe
> "fo\"o.exe"             fo"o.exe
> "foo bar.exe"           foo bar.exe
> "foo\bar.exe"           foo\bar.exe
> "foo\\bar.exe"          foo\\bar.exe
> "foo\\\"bar.exe"        foo\"bar.exe
> "foo\\\bar.exe"         foo\\\bar.exe
> "foo\\\\\\\"bar.exe"    foo\\\"bar.exe
> Filenames containing " are of course invalid, but this is only to
> demonstrate the quoting behaviour.Note that these example strings will
> result in ONE SINGLE argument (i.e. ONE argv[] entry) to the program.
> So i wrote the attached patch to let pkg-config output correctly quoted
> strings on Windows.

Sorry, I missed this earlier. I didn't look too closely at the patch
because I think I'm missing a couple things.

1. What is the problem you're trying to address? I understand it had to do
with weird quoting, but I can't tell what the issue is.

2. What exactly is the patch intended to do? It's light on commit messages
and comments.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the pkg-config mailing list