From ec734606fe0af5257f394fdbe35ad77799adbe13 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Sun, 25 Apr 2010 05:27:19 -0400 Subject: [PATCH] Fix an ISO writer test failure, which cannot write correct UCS2 identifications, on Windows. SVN-Revision: 2276 --- libarchive/archive_write_set_format_iso9660.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c index 48a1c6e73..cfcb415d4 100644 --- a/libarchive/archive_write_set_format_iso9660.c +++ b/libarchive/archive_write_set_format_iso9660.c @@ -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, -- 2.47.3