Escape spaces in autodetected ${prefix} values on Windows

Without this, if the new ${prefix} path contains spaces, they are not
properly quoted in pkg-config's output. Besides the problems this causes
with things using the output, this also causes nonsensical results when
pkg-config splits such options to combine equal options.
This commit is contained in:
John Stumpo 2012-08-21 05:49:07 -07:00 committed by Dan Nicholson
parent 78b419a3df
commit f57fafe1d1

View file

@ -1051,6 +1051,14 @@ parse_line (Package *pkg, const char *untrimmed, const char *path,
*q = '/';
q++;
}
/* Now escape the special characters so that there's no danger
* of arguments that include the prefix getting split.
*/
q = prefix;
prefix = strdup_escape_shell (prefix);
g_free (q);
varname = g_strdup (tag);
debug_spew (" Variable declaration, '%s' overridden with '%s'\n",
tag, prefix);