summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Stumpo <stump@jstump.com>2012-08-21 05:49:07 -0700
committerDan Nicholson <dbn.lists@gmail.com>2012-08-21 05:49:07 -0700
commitf57fafe1d14010961048da5cbf86fe8bda2cd9d0 (patch)
treed1a4cf94a22b3fe720f92fee5f0a3ff6d33369c7
parent78b419a3dfc0d9d60bdeb9db77505d86dfe2f268 (diff)
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.
-rw-r--r--parse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index 6e2a389..76a994c 100644
--- a/parse.c
+++ b/parse.c
@@ -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);