aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/test/test_compat_zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/test/test_compat_zip.c')
-rw-r--r--libarchive/test/test_compat_zip.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libarchive/test/test_compat_zip.c b/libarchive/test/test_compat_zip.c
index bb6d92ef498c..39152206c1bc 100644
--- a/libarchive/test/test_compat_zip.c
+++ b/libarchive/test/test_compat_zip.c
@@ -422,3 +422,29 @@ DEFINE_TEST(test_compat_zip_7)
}
free(p);
}
+
+/**
+ * A file with backslash path separators instead of slashes.
+ * PowerShell's Compress-Archive cmdlet produces such archives.
+ */
+DEFINE_TEST(test_compat_zip_8)
+{
+ const char *refname = "test_compat_zip_8.zip";
+ struct archive *a;
+ struct archive_entry *ae;
+ void *p;
+ size_t s;
+
+ extract_reference_file(refname);
+ p = slurpfile(&s, refname);
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
+ assertEqualIntA(a, ARCHIVE_OK, read_open_memory_minimal(a, p, s, 7));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ /* This file is in the archive as arc\test */
+ assertEqualString("arc/test", archive_entry_pathname(ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+ free(p);
+}