From 6b35e49c2d939a8bc09f5de719ccad24191d8197 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Sat, 1 Oct 2005 10:24:02 +0000 Subject: [PATCH] Handle \ correctly on win32 2005-10-01 Tollef Fog Heen * pkg.c(scan_dir): Turn backslashes into slashes or poptParseArgvString() will eat them when ${prefix} has been expanded in parse_libs(). Thanks to j^ for the patch. --- ChangeLog | 3 +++ pkg.c | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c5777b8..d998378 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * pkg.c (packages_get_var): Don't try to chop if string length is zero. Freedesktop #4034. + (scan_dir): Turn backslashes into slashes or poptParseArgvString() + will eat them when ${prefix} has been expanded in parse_libs(). + Thanks to j^ for the patch. 2005-09-21 Tollef Fog Heen diff --git a/pkg.c b/pkg.c index dbb4288..84f710e 100644 --- a/pkg.c +++ b/pkg.c @@ -144,7 +144,22 @@ scan_dir (const char *dirname) dirnamelen--; dirname_copy[dirnamelen] = '\0'; } - +#ifdef G_OS_WIN32 + { + gchar *p; + /* Turn backslashes into slashes or + * poptParseArgvString() will eat them when ${prefix} + * has been expanded in parse_libs(). + */ + p = dirname; + while (*p) + { + if (*p == '\\') + *p = '/'; + p++; + } + } +#endif dir = opendir (dirname_copy); g_free (dirname_copy); if (!dir) -- 2.39.5