summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2016-01-23 08:47:22 -0800
committerDan Nicholson <dbn.lists@gmail.com>2016-02-26 08:52:25 -0800
commite6d33fb1294266ff0302fcae23ef89e1d523910d (patch)
treee252327aeeda82f02de5626473aced38a250378e
parent8d19fad1a01ac681a3004bb2777ab71b3dcd4eee (diff)
Revert "Unquote values of requested variables"
This reverts commit 50c2867f4a6981e085c721d936c96f174f11f415. 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
-rwxr-xr-xcheck/check-whitespace4
-rw-r--r--pkg.c20
2 files changed, 4 insertions, 20 deletions
diff --git a/check/check-whitespace b/check/check-whitespace
index b062bc0..e4388ba 100755
--- a/check/check-whitespace
+++ b/check/check-whitespace
@@ -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
diff --git a/pkg.c b/pkg.c
index 786ea4c..cbe50d8 100644
--- a/pkg.c
+++ b/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);
}