Permalink
Browse files

Z-1654 Escape characters were excluded in NameFilter.SplitQuoted

  • Loading branch information...
1 parent 3eceb02 commit 0ab2d09ac0e4e42fd937ef519b2ea8ce474601f8 David Pierson committed Mar 3, 2010
Showing with 7 additions and 2 deletions.
  1. +5 −0 src/Core/NameFilter.cs
  2. +2 −2 tests/Zip/ZipTests.cs
View
@@ -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
@@ -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)) {

0 comments on commit 0ab2d09

Please sign in to comment.