]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix cygwin/msys compile errors with cleanup_pathname_win
authorJ. Peter Mugaas <jpmugaas@suddenlink.net>
Tue, 1 Nov 2016 07:26:00 +0000 (03:26 -0400)
committerJ. Peter Mugaas <jpmugaas@suddenlink.net>
Tue, 1 Nov 2016 07:26:00 +0000 (03:26 -0400)
libarchive/archive_write_disk_posix.c

index 17c23b00445783821a93e3864080bd868cef4f63..0c2e541aa6b2cc7b9899234759914c3b66273923 100644 (file)
@@ -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 == '/') {