From: Behdad Esfahbod Date: Tue, 12 Aug 2008 19:10:04 +0000 (-0400) Subject: When canonizing filenames, squash // and remove final / (#bug 16286) X-Git-Tag: 2.7.0~186 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=1bcf4ae5f2348d7956c435d34f2856ebfaccd6c8;p=fontconfig.git When canonizing filenames, squash // and remove final / (#bug 16286) The fact that we now drop final slashes from all filenames without checking that the file name represents a directory may surprise some, but it doesn't bother me really. --- diff --git a/src/fcstr.c b/src/fcstr.c index f56f823..712e23b 100644 --- a/src/fcstr.c +++ b/src/fcstr.c @@ -902,6 +902,9 @@ FcStrCanonAbsoluteFilename (const FcChar8 *s) if (slash) { switch (s - slash) { + case 1: + f -= 1; /* squash // and trim final / from file */ + break; case 2: if (!strncmp ((char *) slash, "/.", 2)) {