From: Tollef Fog Heen Date: Sat, 1 Oct 2005 10:24:02 +0000 (+0000) Subject: Handle \ correctly on win32 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b35e49c2d939a8bc09f5de719ccad24191d8197;p=pkg-config 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. --- 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)