From: Arch Librarian Date: Thu, 14 Jul 2005 13:05:01 +0000 (+0000) Subject: 2002-02-12 Havoc Pennington X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e813e2dfc2d4d2fc2f58fe0efc312e7ed2f3015;p=pkg-config 2002-02-12 Havoc Pennington Author: hp Date: 2002-02-12 21:30:57 GMT 2002-02-12 Havoc Pennington * pkg.c (scan_dir): use g_strdup, and fix the location where we assign the nul byte, so we don't mangle things for directories that end in '/' - reported by Enrico Scholz --- diff --git a/ChangeLog b/ChangeLog index 4da2667..cc40b0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-02-12 Havoc Pennington + + * pkg.c (scan_dir): use g_strdup, and fix the location where + we assign the nul byte, so we don't mangle things for directories + that end in '/' - reported by Enrico Scholz + 2002-02-07 Havoc Pennington * configure.in: 0.11.0 diff --git a/pkg.c b/pkg.c index 50450eb..c3f6e72 100644 --- a/pkg.c +++ b/pkg.c @@ -101,12 +101,12 @@ scan_dir (const char *dirname) /* Use a copy of dirname cause Win32 opendir doesn't like * superfluous trailing (back)slashes in the directory name. */ - char *dirname_copy = strdup (dirname); + char *dirname_copy = g_strdup (dirname); if (dirnamelen > 1 && dirname[dirnamelen-1] == G_DIR_SEPARATOR) { dirnamelen--; - dirname_copy[dirnamelen-1] = '\0'; + dirname_copy[dirnamelen] = '\0'; } dir = opendir (dirname_copy);