Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Z-1654 Escape characters were excluded in NameFilter.SplitQuoted

  • Loading branch information...
commit 0ab2d09ac0e4e42fd937ef519b2ea8ce474601f8 1 parent 3eceb02
David Pierson authored
Showing with 7 additions and 2 deletions.
  1. +5 −0 src/Core/NameFilter.cs
  2. +2 −2 tests/Zip/ZipTests.cs
View
5 src/Core/NameFilter.cs
@@ -33,6 +33,8 @@
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
+// HISTORY
+// 2010-03-03 Z-1654 Fixed bug where escape characters were excluded in SplitQuoted()
using System;
using System.Collections;
@@ -158,6 +160,9 @@ public static string[] SplitQuoted(string original)
throw new ArgumentException("Missing terminating escape character", "original");
#endif
}
+ // include escape if this is not an escaped separator
+ if (Array.IndexOf(separators, original[endIndex]) < 0)
+ b.Append(escape);
b.Append(original[endIndex]);
}
View
4 tests/Zip/ZipTests.cs
@@ -2598,7 +2598,7 @@ public class FastZipHandling : ZipBase
[Category("CreatesTempFile")]
public void Basics()
{
- const string tempName1 = "a.dat";
+ const string tempName1 = "a(1).dat";
MemoryStream target = new MemoryStream();
@@ -2610,7 +2610,7 @@ public void Basics()
try {
FastZip fastZip = new FastZip();
- fastZip.CreateZip(target, tempFilePath, false, @"a\.dat", null);
+ fastZip.CreateZip(target, tempFilePath, false, @"a\(1\)\.dat", null);
MemoryStream archive = new MemoryStream(target.ToArray());
using (ZipFile zf = new ZipFile(archive)) {
Please sign in to comment.
Something went wrong with that request. Please try again.