svn commit: r189386 - head/lib/libarchive

Tim Kientzle kientzle at FreeBSD.org
Wed Mar 4 16:44:13 PST 2009


Author: kientzle
Date: Thu Mar  5 00:44:12 2009
New Revision: 189386
URL: http://svn.freebsd.org/changeset/base/189386

Log:
  Merge r356 and r358 from libarchive.googlecode.com: Remove a Windows
  special case from archive_entry.c, add one to archive_check_magic.c.

Modified:
  head/lib/libarchive/archive_check_magic.c
  head/lib/libarchive/archive_entry.c

Modified: head/lib/libarchive/archive_check_magic.c
==============================================================================
--- head/lib/libarchive/archive_check_magic.c	Thu Mar  5 00:42:50 2009	(r189385)
+++ head/lib/libarchive/archive_check_magic.c	Thu Mar  5 00:44:12 2009	(r189386)
@@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$");
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#ifdef _WIN32
+#include <windows.h>
+#include <winbase.h>
+#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. */
 }

Modified: head/lib/libarchive/archive_entry.c
==============================================================================
--- head/lib/libarchive/archive_entry.c	Thu Mar  5 00:42:50 2009	(r189385)
+++ head/lib/libarchive/archive_entry.c	Thu Mar  5 00:44:12 2009	(r189386)
@@ -62,9 +62,6 @@ __FBSDID("$FreeBSD$");
 #ifdef HAVE_WCHAR_H
 #include <wchar.h>
 #endif
-#ifdef _WIN32
-#include <windows.h>
-#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;


More information about the svn-src-head mailing list