Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144694
b: refs/heads/master
c: d37dc42
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Layton authored and Steve French committed Apr 30, 2009
1 parent 17a0550 commit 69fff09
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cbb7fe129bb2b836083ebcc256c43faff4b48cc2
refs/heads/master: d37dc42ab6f040b8f0f2962ab219c5b2accf748d
19 changes: 19 additions & 0 deletions trunk/include/linux/nls.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,25 @@ static inline int nls_strnicmp(struct nls_table *t, const unsigned char *s1,
return 0;
}

/*
* nls_nullsize - return length of null character for codepage
* @codepage - codepage for which to return length of NULL terminator
*
* Since we can't guarantee that the null terminator will be a particular
* length, we have to check against the codepage. If there's a problem
* determining it, assume a single-byte NULL terminator.
*/
static inline int
nls_nullsize(const struct nls_table *codepage)
{
int charlen;
char tmp[NLS_MAX_CHARSET_SIZE];

charlen = codepage->uni2char(0, tmp, NLS_MAX_CHARSET_SIZE);

return charlen > 0 ? charlen : 1;
}

#define MODULE_ALIAS_NLS(name) MODULE_ALIAS("nls_" __stringify(name))

#endif /* _LINUX_NLS_H */
Expand Down

0 comments on commit 69fff09

Please sign in to comment.