mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2025-12-20 05:30:03 +01:00
Revert "Unquote values of requested variables"
This reverts commit 50c2867f4a.
g_shell_quote doesn't match the quoting behavior of pkg-config when the
same variables are output via --cflags and similar.
https://bugs.freedesktop.org/show_bug.cgi?id=93284
This commit is contained in:
parent
8d19fad1a0
commit
e6d33fb129
2 changed files with 4 additions and 20 deletions
|
|
@ -4,10 +4,6 @@ set -e
|
|||
|
||||
. ${srcdir}/common
|
||||
|
||||
# variables come out unquoted
|
||||
RESULT='/usr/white space/include'
|
||||
run_test --variable=includedir whitespace
|
||||
|
||||
# expect cflags from whitespace
|
||||
RESULT='-Dlala=misc -I/usr/white\ space/include -I$(top_builddir) -Iinclude\ dir -Iother\ include\ dir'
|
||||
run_test --cflags whitespace
|
||||
|
|
|
|||
20
pkg.c
20
pkg.c
|
|
@ -1076,7 +1076,6 @@ packages_get_var (GList *pkgs,
|
|||
GList *tmp;
|
||||
GString *str;
|
||||
char *retval;
|
||||
GError *error = NULL;
|
||||
|
||||
str = g_string_new ("");
|
||||
|
||||
|
|
@ -1084,25 +1083,14 @@ packages_get_var (GList *pkgs,
|
|||
while (tmp != NULL)
|
||||
{
|
||||
Package *pkg = tmp->data;
|
||||
char *var, *unquoted_var;
|
||||
char *var;
|
||||
|
||||
var = package_get_var (pkg, varname);
|
||||
|
||||
if (var)
|
||||
{
|
||||
unquoted_var = g_shell_unquote (var, &error);
|
||||
if (unquoted_var != NULL)
|
||||
{
|
||||
g_string_append (str, unquoted_var);
|
||||
g_string_append_c (str, ' ');
|
||||
g_free (unquoted_var);
|
||||
}
|
||||
else
|
||||
{
|
||||
verbose_error ("Couldn't unquote value of \"%s\": %s\n",
|
||||
varname, error ? error->message : "unknown");
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
g_string_append (str, var);
|
||||
g_string_append_c (str, ' ');
|
||||
g_free (var);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue