diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-01-23 18:18:50 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-01-23 18:24:43 +0000 |
| commit | 840dcaae21c2b8b478e5f1bfed599885f6177672 (patch) | |
| tree | d3411f64ab33b2358d5c5bf582b398819f54ab9f /lib | |
| parent | 7fb1347f1318a47e7304925ded48426536eb2541 (diff) | |
Handle joining of absolute zip paths
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/zipfile.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/zipfile.js b/lib/zipfile.js index 708b07a..91c5f04 100644 --- a/lib/zipfile.js +++ b/lib/zipfile.js @@ -38,7 +38,11 @@ function openArrayBuffer(arrayBuffer) { } function joinZipPath(first, second) { - // In general, we should check first and second for trailing and leading slashes, - // but in our specific case this seems to be sufficient - return first + "/" + second; + if (second.charAt(0) === "/") { + return second; + } else { + // In general, we should check first and second for trailing and leading slashes, + // but in our specific case this seems to be sufficient + return first + "/" + second; + } } |
