From: Rich Mahn Date: Mon, 4 Apr 2011 22:46:06 +0000 (-0700) Subject: vfat: Fix mangling of directory names starting with .. X-Git-Tag: syslinux-4.04-pre19~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da9c8bcfbb899975a8254e0a97945074c359ff19;p=profile%2Fivi%2Fsyslinux.git vfat: Fix mangling of directory names starting with .. We need to handle directory names starting with .. correctly. Signed-off-by: H. Peter Anvin --- diff --git a/core/fs/fat/fat.c b/core/fs/fat/fat.c index c896b5e..d307926 100644 --- a/core/fs/fat/fat.c +++ b/core/fs/fat/fat.c @@ -254,8 +254,10 @@ static void vfat_mangle_name(char *dst, const char *src) while (1) { if (dst == p) break; - if (*(dst-1) == '/' && dst-1 == p) /* it's the '/' case */ - break; + if (*(dst-1) == '/' && dst-1 == p) /* it's the '/' case */ + break; + if (dst-2 == p && *(dst-2) == '.' && *(dst-1) == '.' ) /* the '..' case */ + break; if ((*(dst-1) != '/') && (*(dst-1) != '.')) break;