From 2e06593ef58de9ea7a3af2885b2fca737de0e6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20M=2E=20Gonz=C3=A1lez?= Date: Sat, 23 May 2020 05:05:21 -0300 Subject: [PATCH] Allow seeking a PartialInputStream to the very end. --- src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs b/src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs index 9a7f64e9f..6cacf2da8 100644 --- a/src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs +++ b/src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs @@ -4229,7 +4229,7 @@ public override long Seek(long offset, SeekOrigin origin) throw new ArgumentException("Negative position is invalid"); } - if (newPos >= end_) + if (newPos > end_) { throw new IOException("Cannot seek past end"); } @@ -4266,7 +4266,7 @@ public override long Position throw new ArgumentException("Negative position is invalid"); } - if (newPos >= end_) + if (newPos > end_) { throw new InvalidOperationException("Cannot seek past end"); }