From 764f7989a081cd97d149de2ae6d6db7b4d240ef1 Mon Sep 17 00:00:00 2001 From: "J. Peter Mugaas" Date: Tue, 1 Nov 2016 03:26:00 -0400 Subject: [PATCH] Fix cygwin/msys compile errors with cleanup_pathname_win --- libarchive/archive_write_disk_posix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index 17c23b004..0c2e541aa 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -2625,7 +2625,7 @@ check_symlinks(struct archive_write_disk *a) * See also : http://msdn.microsoft.com/en-us/library/aa365247.aspx */ static void -cleanup_pathname_win(struct archive_write_disk *a) +cleanup_pathname_win(char *path) { wchar_t wc; char *p; @@ -2636,7 +2636,7 @@ cleanup_pathname_win(struct archive_write_disk *a) mb = 0; complete = 1; utf8 = (strcmp(nl_langinfo(CODESET), "UTF-8") == 0)? 1: 0; - for (p = a->name; *p != '\0'; p++) { + for (p = path; *p != '\0'; p++) { ++alen; if (*p == '\\') { /* If previous byte is smaller than 128, @@ -2661,7 +2661,7 @@ cleanup_pathname_win(struct archive_write_disk *a) /* * Convert path separator in wide-character. */ - p = a->name; + p = path; while (*p != '\0' && alen) { l = mbtowc(&wc, p, alen); if (l == (size_t)-1) { @@ -2703,7 +2703,7 @@ cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *err } #if defined(__CYGWIN__) - cleanup_pathname_win(a); + cleanup_pathname_win(path); #endif /* Skip leading '/'. */ if (*src == '/') { -- 2.47.2