diff options
author | 2023-04-07 19:42:02 +0000 | |
---|---|---|
committer | 2023-04-17 14:58:02 +0000 | |
commit | c6a918aa116c958d3504b0172c86ff6067f45263 (patch) | |
tree | 73ec004985eda53f7bce8b8c0adba8616772f45a | |
parent | 7bfe443875545025a4e36caa43792c743cd73434 (diff) |
add support for escaping for zip2zip
Change-Id: I6c2f39e24247752de065fd3116f670639322b943
Bug: 270896651
Test: zip2zip tests
-rw-r--r-- | cmd/zip2zip/zip2zip.go | 6 | ||||
-rw-r--r-- | cmd/zip2zip/zip2zip_test.go | 14 |
2 files changed, 7 insertions, 13 deletions
diff --git a/cmd/zip2zip/zip2zip.go b/cmd/zip2zip/zip2zip.go index 491267b01..5ab96568d 100644 --- a/cmd/zip2zip/zip2zip.go +++ b/cmd/zip2zip/zip2zip.go @@ -128,12 +128,6 @@ func zip2zip(reader *zip.Reader, writer *zip.Writer, sortOutput, sortJava, setTi } for _, arg := range args { - // Reserve escaping for future implementation, so make sure no - // one is using \ and expecting a certain behavior. - if strings.Contains(arg, "\\") { - return fmt.Errorf("\\ characters are not currently supported") - } - input, output := includeSplit(arg) var includeMatches []pair diff --git a/cmd/zip2zip/zip2zip_test.go b/cmd/zip2zip/zip2zip_test.go index 2c4e00569..c238098ec 100644 --- a/cmd/zip2zip/zip2zip_test.go +++ b/cmd/zip2zip/zip2zip_test.go @@ -38,13 +38,6 @@ var testCases = []struct { storedFiles []string err error }{ - { - name: "unsupported \\", - - args: []string{"a\\b:b"}, - - err: fmt.Errorf("\\ characters are not currently supported"), - }, { // This is modelled after the update package build rules in build/make/core/Makefile name: "filter globs", @@ -406,6 +399,13 @@ var testCases = []struct { "b/a/b", }, }, + { + name: "escaping", + + inputFiles: []string{"a"}, + args: []string{"\\a"}, + outputFiles: []string{"a"}, + }, } func errorString(e error) string { |