Skip to content

Commit

Permalink
fix issue dorimanx#46
Browse files Browse the repository at this point in the history
  • Loading branch information
lqs committed Oct 11, 2014
1 parent 2bca459 commit 3c73004
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions exfat_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ static int exfat_d_hashi(const struct dentry *dentry, const struct inode *inode,
struct qstr *qstr)
#endif
{
struct nls_table *t = EXFAT_SB(dentry->d_sb)->nls_io;
struct super_block *sb = dentry->d_sb;
const unsigned char *name;
unsigned int len;
unsigned long hash;
Expand All @@ -364,7 +364,7 @@ static int exfat_d_hashi(const struct dentry *dentry, const struct inode *inode,

hash = init_name_hash();
while (len--)
hash = partial_name_hash(nls_tolower(t, *name++), hash);
hash = partial_name_hash(nls_upper(sb, *name++), hash);
qstr->hash = end_name_hash(hash);

return 0;
Expand All @@ -385,7 +385,10 @@ static int exfat_cmpi(const struct dentry *parent, const struct inode *pinode,
alen = exfat_striptail_len(name);
blen = __exfat_striptail_len(len, str);
if (alen == blen) {
if (nls_strnicmp(t, name->name, str, alen) == 0)
if (t == NULL) {
if (strnicmp(name->name, str, alen) == 0)
return 0;
} else if (nls_strnicmp(t, name->name, str, alen) == 0)
return 0;
}
return 1;
Expand Down

0 comments on commit 3c73004

Please sign in to comment.