]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcstr.c
When canonizing filenames, squash // and remove final / (#bug 16286)
[fontconfig.git] / src / fcstr.c
index f56f823bc2f99a0c5600e60ad4cd9b62c3808767..712e23b8c2dfb21e95c98fa0948f2b4c1e4e3aa0 100644 (file)
@@ -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))
                    {