From 1bcf4ae5f2348d7956c435d34f2856ebfaccd6c8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 12 Aug 2008 15:10:04 -0400 Subject: [PATCH] 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. --- src/fcstr.c | 3 +++ 1 file changed, 3 insertions(+) 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)) { -- 2.39.5