summaryrefslogtreecommitdiff
path: root/src/fcstr.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-08-12 15:10:04 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-02-13 16:53:54 -0800
commit1bcf4ae5f2348d7956c435d34f2856ebfaccd6c8 (patch)
tree0bad04498cf25a2fbe0ea396283d9de88f07f9cb /src/fcstr.c
parentb21bea3731106ef30224f9255c4232d6e2607803 (diff)
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.
Diffstat (limited to 'src/fcstr.c')
-rw-r--r--src/fcstr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fcstr.c b/src/fcstr.c
index f56f823b..712e23b8 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))
{