]> git.sven.stormbind.net Git - sven/exfat-utils.git/commitdiff
Add debian/patches/utf16-fix - fix handling of characters beyond BMP. Thanks to Vladi...
authorSven Hoexter <sven@timegate.de>
Mon, 21 May 2012 18:26:17 +0000 (20:26 +0200)
committerSven Hoexter <sven@timegate.de>
Mon, 21 May 2012 18:35:35 +0000 (20:35 +0200)
debian/changelog
debian/patches/series
debian/patches/utf16-fix [new file with mode: 0644]

index 47bc2edea89fa3fb533fe6d4ceb09e576104d138..33eedfcd0d7ab461189dd0a6a22b1ec3a4efd602 100644 (file)
@@ -8,6 +8,8 @@ exfat-utils (0.9.7-2) UNRELEASED; urgency=low
     SConstruct file.
   * Add debian/patches/honor-cppflags - scons should use exported
     CPPFLAGS.
+  * Add debian/patches/utf16-fix - fix handling of characters beyond BMP.
+    Thanks to Vladimir Serbinenko <phcoder@gmail.com>.
 
  -- Sven Hoexter <hoexter@debian.org>  Thu, 17 May 2012 13:50:03 +0200
 
index 06c25e169c3c9b9f8b21264b8d4b2ed7beb9e6fa..e3ec1be4165aa2c5084e870a62169d3311d3a2e8 100644 (file)
@@ -1 +1,2 @@
 honor-cppflags
+utf16-fix
diff --git a/debian/patches/utf16-fix b/debian/patches/utf16-fix
new file mode 100644 (file)
index 0000000..10bce32
--- /dev/null
@@ -0,0 +1,22 @@
+Applied upstream in r283.
+http://code.google.com/p/exfat/source/detail?r=283
+Closes Debian bug #672898.
+Thanks to Vladimir Serbinenko <phcoder@gmail.com>.
+--- a/libexfat/utf.c
++++ b/libexfat/utf.c
+@@ -89,6 +89,7 @@ static const le16_t* utf16_to_wchar(cons
+                       return NULL;
+               *wc = ((wchar_t) (le16_to_cpu(input[0]) & 0x3ff) << 10);
+               *wc |= (le16_to_cpu(input[1]) & 0x3ff);
++              *wc += 0x10000;
+               return input + 2;
+       }
+       else
+@@ -186,6 +187,7 @@ static le16_t* wchar_to_utf16(le16_t* ou
+       }
+       if (outsize < 2)
+               return NULL;
++      wc -= 0x10000;
+       output[0] = cpu_to_le16(0xd800 | ((wc >> 10) & 0x3ff));
+       output[1] = cpu_to_le16(0xdc00 | (wc & 0x3ff));
+       return output + 2;