]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Solve warning by excluding more code to _WIN32 in file_open()
authorMartin Matuska <martin@matuska.org>
Thu, 13 Feb 2020 00:20:18 +0000 (01:20 +0100)
committerMartin Matuska <martin@matuska.org>
Thu, 13 Feb 2020 00:20:18 +0000 (01:20 +0100)
libarchive/archive_read_open_filename.c

index 86635e21928e32bee46bd63d1df8efc26be1e965..561289b694beb0f5b93da1b82913eac3d2e5f869 100644 (file)
@@ -221,7 +221,9 @@ file_open(struct archive *a, void *client_data)
        struct read_file_data *mine = (struct read_file_data *)client_data;
        void *buffer;
        const char *filename = NULL;
+#if defined(_WIN32) && !defined(__CYGWIN__)
        const wchar_t *wfilename = NULL;
+#endif
        int fd = -1;
        int is_disk_like = 0;
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
@@ -281,10 +283,12 @@ file_open(struct archive *a, void *client_data)
 #endif
        }
        if (fstat(fd, &st) != 0) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
                if (mine->filename_type == FNT_WCS)
                        archive_set_error(a, errno, "Can't stat '%S'",
                            wfilename);
                else
+#endif
                        archive_set_error(a, errno, "Can't stat '%s'",
                            filename);
                goto fail;