aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/samples/poc.zipbin0 -> 306 bytes
-rw-r--r--test/old/testdir/test_plugin_zip.vim23
2 files changed, 23 insertions, 0 deletions
diff --git a/test/old/testdir/samples/poc.zip b/test/old/testdir/samples/poc.zip
new file mode 100644
index 0000000000..8b2b44b96a
--- /dev/null
+++ b/test/old/testdir/samples/poc.zip
Binary files differ
diff --git a/test/old/testdir/test_plugin_zip.vim b/test/old/testdir/test_plugin_zip.vim
index a817d8371e..ba0a6778bc 100644
--- a/test/old/testdir/test_plugin_zip.vim
+++ b/test/old/testdir/test_plugin_zip.vim
@@ -235,3 +235,26 @@ func Test_zip_glob_fname()
bw
endfunc
+
+func Test_zip_fname_leading_hyphen()
+ CheckNotMSWindows
+
+ "## copy sample zip file
+ if !filecopy("samples/poc.zip", "X.zip")
+ call assert_report("Can't copy samples/poc.zip")
+ return
+ endif
+ defer delete("X.zip")
+ defer delete('-d', 'rf')
+ defer delete('/tmp/pwned', 'rf')
+
+ e X.zip
+
+ :1
+ let fname = '-d/tmp'
+ call search('\V' .. fname)
+ normal x
+ call assert_true(filereadable('-d/tmp'))
+ call assert_false(filereadable('/tmp/pwned'))
+ bw
+endfunc