From 1d26eb2b97035793d147fa673208fc385a3481f3 Mon Sep 17 00:00:00 2001 From: jpandre Date: Wed, 12 Aug 2009 15:35:11 +0000 Subject: [PATCH] Fixed checking spaces in Win32 names --- libntfs-3g/unistr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libntfs-3g/unistr.c b/libntfs-3g/unistr.c index 764e297a..55ce1e8f 100644 --- a/libntfs-3g/unistr.c +++ b/libntfs-3g/unistr.c @@ -1085,7 +1085,7 @@ void ntfs_ucsfree(ntfschar *ucs) BOOL ntfs_forbidden_chars(const ntfschar *name, int len) { - BOOL forbidden = FALSE; + BOOL forbidden; int ch; int i; u32 mainset = (1L << ('\"' - 0x20)) @@ -1096,9 +1096,12 @@ BOOL ntfs_forbidden_chars(const ntfschar *name, int len) | (1L << ('>' - 0x20)) | (1L << ('?' - 0x20)); + forbidden = (len == 0) + || (le16_to_cpu(name[0]) == ' ') + || (le16_to_cpu(name[len-1]) == ' '); for (i=0; i