]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix an ISO writer test failure, which cannot write correct UCS2 identifications,...
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 25 Apr 2010 09:27:19 +0000 (05:27 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 25 Apr 2010 09:27:19 +0000 (05:27 -0400)
SVN-Revision: 2276

libarchive/archive_write_set_format_iso9660.c

index 48a1c6e73389f8997349815e8c6103e86ed48d29..cfcb415d4a754ee10e9d44a5ad8a0c56fe98d723 100644 (file)
@@ -7352,6 +7352,15 @@ mbstobeutf16s(unsigned char *utf16, size_t utf16_size,
                                        free(tp);
                                }
                        }
+               } else if (count > 0) {
+                       uint16_t val = 1;
+                       if (archive_be16dec(&val) != 1) {
+                               while (utf16_size > 0) {
+                                       archive_be16enc(utf16, *(uint16_t *)utf16);
+                                               utf16 += 2;
+                                               utf16_size -= 2;
+                                       }
+                       }
                }
        } else
                count = MultiByteToWideChar(CP_ACP,