Handle \ correctly on win32

2005-10-01  Tollef Fog Heen  <tfheen@err.no>

        * 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.
This commit is contained in:
Tollef Fog Heen 2005-10-01 10:24:02 +00:00
parent d41fc58c55
commit 6b35e49c2d
2 changed files with 19 additions and 1 deletions

View file

@ -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 <tfheen@err.no>

17
pkg.c
View file

@ -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)