~ubuntu-branches/ubuntu/precise/fuse-exfat/precise-backports

« back to all changes in this revision

Viewing changes to debian/patches/utf16-fix

  • Committer: Package Import Robot
  • Author(s): Sven Hoexter
  • Date: 2012-08-12 20:05:10 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120812200510-i7a1tp82r4fwvav9
Tags: 0.9.8-1
* New upstream release.
* Dropped all patches - merged upstream.
* Dropped all usage of quilt - currently not required.
* No longer use CFLAGS as CCFLAGS, the SConstruct file
  now honors CCFLAGS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Applied upstream in r283.
2
 
http://code.google.com/p/exfat/source/detail?r=283
3
 
Closes Debian bug #672898.
4
 
Thanks to Vladimir Serbinenko <phcoder@gmail.com>.
5
 
--- a/libexfat/utf.c
6
 
+++ b/libexfat/utf.c
7
 
@@ -89,6 +89,7 @@ static const le16_t* utf16_to_wchar(cons
8
 
                        return NULL;
9
 
                *wc = ((wchar_t) (le16_to_cpu(input[0]) & 0x3ff) << 10);
10
 
                *wc |= (le16_to_cpu(input[1]) & 0x3ff);
11
 
+               *wc += 0x10000;
12
 
                return input + 2;
13
 
        }
14
 
        else
15
 
@@ -186,6 +187,7 @@ static le16_t* wchar_to_utf16(le16_t* ou
16
 
        }
17
 
        if (outsize < 2)
18
 
                return NULL;
19
 
+       wc -= 0x10000;
20
 
        output[0] = cpu_to_le16(0xd800 | ((wc >> 10) & 0x3ff));
21
 
        output[1] = cpu_to_le16(0xdc00 | (wc & 0x3ff));
22
 
        return output + 2;