Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddAll with includeCurrentFolder=false has leading slashes on subdirectories in the archive #18

Open
gavbaa opened this issue Feb 29, 2016 · 0 comments

Comments

@gavbaa
Copy link
Contributor

gavbaa commented Feb 29, 2016

Given a simple zip creation setup like:

    zipFile := new(archivex.ZipFile)
    buf := new(bytes.Buffer)
    zipFile.Writer = zip.NewWriter(buf)
    zipFile.AddAll("/tmp/dir", false)
    zipFile.Close()

The AddAll specifies includeCurrentFolder=false. There's no issues when it's true.

The produced .zip gives me the following when I attempt to unzip it.

➜  unzip -t blah.zip
Archive:  blah.zip
    testing: a.xsd       OK
    testing: b.xsd              OK
    testing: /thing/                   OK
    testing: /thing/blank.htm          OK
    testing: /thing/easyxdm/           OK
    testing: /thing/easyxdm/MIT-license.txt   OK
    testing: /thing/index.htm          OK
    testing: /thing/js/                OK
    testing: /thing/js/API.js   OK
    testing: /thing/js/Utils.js        OK

The leading slashes should not be there, and could cause issues with some zip clients.

I've submitted PR #17 to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant