summaryrefslogtreecommitdiff
path: root/fs/fat/namei_vfat.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-30 16:31:14 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-30 16:31:14 (GMT)
commit4c8f1cb266cba4d1052f524d04df839d8f732ace (patch)
tree4bf2e6bcc56dcce2c919bca969f6626c8f18b7e6 /fs/fat/namei_vfat.c
parent9c1fe834c1bd7725b411055c66886b64c928083d (diff)
parented248b290da7297c9b9a3ff180f5eee4db016224 (diff)
downloadlinux-4c8f1cb266cba4d1052f524d04df839d8f732ace.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6: fat: Check s_dirt in fat_sync_fs() vfat: change the default from shortname=lower to shortname=mixed fat/nls: Fix handling of utf8 invalid char
Diffstat (limited to 'fs/fat/namei_vfat.c')
-rw-r--r--fs/fat/namei_vfat.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index cb6e835..f565f24 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -499,17 +499,10 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname,
int charlen;
if (utf8) {
- int name_len = strlen(name);
-
- *outlen = utf8s_to_utf16s(name, PATH_MAX, (wchar_t *) outname);
-
- /*
- * We stripped '.'s before and set len appropriately,
- * but utf8s_to_utf16s doesn't care about len
- */
- *outlen -= (name_len - len);
-
- if (*outlen > 255)
+ *outlen = utf8s_to_utf16s(name, len, (wchar_t *)outname);
+ if (*outlen < 0)
+ return *outlen;
+ else if (*outlen > 255)
return -ENAMETOOLONG;
op = &outname[*outlen * sizeof(wchar_t)];