Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91812
b: refs/heads/master
c: 34f953d
h: refs/heads/master
v: v3
  • Loading branch information
marcin.slusarz@gmail.com authored and Jan Kara committed Apr 17, 2008
1 parent 238ffa8 commit bd8f083
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6305a0a9d559e97807b8bc6d5250fd525dc571a7
refs/heads/master: 34f953ddfd15da8feb5b8383c93c35dc57202b66
19 changes: 8 additions & 11 deletions trunk/fs/udf/unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,35 +249,32 @@ static int udf_UTF8toCS0(dstring *ocu, struct ustr *utf, int length)
}

static int udf_CS0toNLS(struct nls_table *nls, struct ustr *utf_o,
struct ustr *ocu_i)
const struct ustr *ocu_i)
{
uint8_t *ocu;
uint32_t c;
const uint8_t *ocu;
uint8_t cmp_id, ocu_len;
int i;

ocu = ocu_i->u_name;

ocu_len = ocu_i->u_len;
cmp_id = ocu_i->u_cmpID;
utf_o->u_len = 0;

if (ocu_len == 0) {
memset(utf_o, 0, sizeof(struct ustr));
utf_o->u_cmpID = 0;
utf_o->u_len = 0;
return 0;
}

if ((cmp_id != 8) && (cmp_id != 16)) {
cmp_id = ocu_i->u_cmpID;
if (cmp_id != 8 && cmp_id != 16) {
memset(utf_o, 0, sizeof(struct ustr));
printk(KERN_ERR "udf: unknown compression code (%d) stri=%s\n",
cmp_id, ocu_i->u_name);
return 0;
}

ocu = ocu_i->u_name;
utf_o->u_len = 0;
for (i = 0; (i < ocu_len) && (utf_o->u_len <= (UDF_NAME_LEN - 3));) {
/* Expand OSTA compressed Unicode to Unicode */
c = ocu[i++];
uint32_t c = ocu[i++];
if (cmp_id == 16)
c = (c << 8) | ocu[i++];

Expand Down

0 comments on commit bd8f083

Please sign in to comment.