Commit c0f06deb authored by Stephen Rothwell's avatar Stephen Rothwell

Merge commit 'fatfs/master'

parents 558a2618 95523475
...@@ -102,7 +102,7 @@ shortname=lower|win95|winnt|mixed ...@@ -102,7 +102,7 @@ shortname=lower|win95|winnt|mixed
winnt: emulate the Windows NT rule for display/create. winnt: emulate the Windows NT rule for display/create.
mixed: emulate the Windows NT rule for display, mixed: emulate the Windows NT rule for display,
emulate the Windows 95 rule for create. emulate the Windows 95 rule for create.
Default setting is `lower'. Default setting is `mixed'.
tz=UTC -- Interpret timestamps as UTC rather than local time. tz=UTC -- Interpret timestamps as UTC rather than local time.
This option disables the conversion of timestamps This option disables the conversion of timestamps
......
...@@ -820,7 +820,7 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt) ...@@ -820,7 +820,7 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt)
seq_puts(m, ",shortname=mixed"); seq_puts(m, ",shortname=mixed");
break; break;
case VFAT_SFN_DISPLAY_LOWER | VFAT_SFN_CREATE_WIN95: case VFAT_SFN_DISPLAY_LOWER | VFAT_SFN_CREATE_WIN95:
/* seq_puts(m, ",shortname=lower"); */ seq_puts(m, ",shortname=lower");
break; break;
default: default:
seq_puts(m, ",shortname=unknown"); seq_puts(m, ",shortname=unknown");
...@@ -971,7 +971,7 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug, ...@@ -971,7 +971,7 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug,
opts->codepage = fat_default_codepage; opts->codepage = fat_default_codepage;
opts->iocharset = fat_default_iocharset; opts->iocharset = fat_default_iocharset;
if (is_vfat) { if (is_vfat) {
opts->shortname = VFAT_SFN_DISPLAY_LOWER|VFAT_SFN_CREATE_WIN95; opts->shortname = VFAT_SFN_DISPLAY_WINNT|VFAT_SFN_CREATE_WIN95;
opts->rodir = 0; opts->rodir = 0;
} else { } else {
opts->shortname = 0; opts->shortname = 0;
......
...@@ -499,17 +499,10 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, ...@@ -499,17 +499,10 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname,
int charlen; int charlen;
if (utf8) { if (utf8) {
int name_len = strlen(name); *outlen = utf8s_to_utf16s(name, len, (wchar_t *)outname);
if (*outlen < 0)
*outlen = utf8s_to_utf16s(name, PATH_MAX, (wchar_t *) outname); return *outlen;
else if (*outlen > 255)
/*
* We stripped '.'s before and set len appropriately,
* but utf8s_to_utf16s doesn't care about len
*/
*outlen -= (name_len - len);
if (*outlen > 255)
return -ENAMETOOLONG; return -ENAMETOOLONG;
op = &outname[*outlen * sizeof(wchar_t)]; op = &outname[*outlen * sizeof(wchar_t)];
......
...@@ -124,10 +124,10 @@ int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs) ...@@ -124,10 +124,10 @@ int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs)
while (*s && len > 0) { while (*s && len > 0) {
if (*s & 0x80) { if (*s & 0x80) {
size = utf8_to_utf32(s, len, &u); size = utf8_to_utf32(s, len, &u);
if (size < 0) { if (size < 0)
/* Ignore character and move on */ return -EINVAL;
size = 1;
} else if (u >= PLANE_SIZE) { if (u >= PLANE_SIZE) {
u -= PLANE_SIZE; u -= PLANE_SIZE;
*op++ = (wchar_t) (SURROGATE_PAIR | *op++ = (wchar_t) (SURROGATE_PAIR |
((u >> 10) & SURROGATE_BITS)); ((u >> 10) & SURROGATE_BITS));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment