From 30b7287affe2565ee29603ed1aea1505d6d2a5c8 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Thu, 5 Mar 2009 00:44:12 +0000 Subject: [PATCH] Merge r356 and r358 from libarchive.googlecode.com: Remove a Windows special case from archive_entry.c, add one to archive_check_magic.c. --- lib/libarchive/archive_check_magic.c | 8 ++++++++ lib/libarchive/archive_entry.c | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/libarchive/archive_check_magic.c b/lib/libarchive/archive_check_magic.c index b8934cec5155..e1d35c540d0f 100644 --- a/lib/libarchive/archive_check_magic.c +++ b/lib/libarchive/archive_check_magic.c @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_UNISTD_H #include #endif +#ifdef _WIN32 +#include +#include +#endif #include "archive_private.h" @@ -52,6 +56,10 @@ errmsg(const char *m) static void diediedie(void) { +#if defined(_WIN32) && defined(_DEBUG) + /* Cause a breakpoint exception */ + DebugBreak(); +#endif *(char *)0 = 1; /* Deliberately segfault and force a coredump. */ _exit(1); /* If that didn't work, just exit with an error. */ } diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c index 063632435902..095e4933deec 100644 --- a/lib/libarchive/archive_entry.c +++ b/lib/libarchive/archive_entry.c @@ -62,9 +62,6 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_WCHAR_H #include #endif -#ifdef _WIN32 -#include -#endif #include "archive.h" #include "archive_entry.h" @@ -230,13 +227,7 @@ aes_get_wcs(struct aes *aes) w = (wchar_t *)malloc((wcs_length + 1) * sizeof(wchar_t)); if (w == NULL) __archive_errx(1, "No memory for aes_get_wcs()"); -#ifndef _WIN32 r = mbstowcs(w, aes->aes_mbs.s, wcs_length); -#else - r = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, - aes->aes_mbs.s, (int)aes->aes_mbs.length, w, - (int)wcs_length); -#endif if (r > 0) { w[r] = 0; aes->aes_set |= AES_SET_WCS;