From: Jean-Pierre A. <jp...@us...> - 2009-08-12 15:35:20
|
Update of /cvsroot/ntfs-3g/ntfs-3g/libntfs-3g In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5449/ntfs-3g/libntfs-3g Modified Files: Tag: PERMISSION_HANDLING_BRANCH unistr.c Log Message: Fixed checking spaces in Win32 names Index: unistr.c =================================================================== RCS file: /cvsroot/ntfs-3g/ntfs-3g/libntfs-3g/unistr.c,v retrieving revision 1.1.1.1.2.8 retrieving revision 1.1.1.1.2.9 diff -u -d -r1.1.1.1.2.8 -r1.1.1.1.2.9 --- unistr.c 1 Jul 2009 19:45:59 -0000 1.1.1.1.2.8 +++ unistr.c 12 Aug 2009 15:35:11 -0000 1.1.1.1.2.9 @@ -1085,7 +1085,7 @@ 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 @@ | (1L << ('>' - 0x20)) | (1L << ('?' - 0x20)); + forbidden = (len == 0) + || (le16_to_cpu(name[0]) == ' ') + || (le16_to_cpu(name[len-1]) == ' '); for (i=0; i<len; i++) { ch = le16_to_cpu(name[i]); - if ((ch <= 0x20) + if ((ch < 0x20) || ((ch < 0x40) && ((1L << (ch - 0x20)) & mainset)) || (ch == '\\') |