Skip to content

Commit

Permalink
BugFix: Empty files no longer recognized as GZip-Files (if not gzip s…
Browse files Browse the repository at this point in the history
…uffix)
  • Loading branch information
Pascal-Krenckel committed Dec 16, 2021
1 parent bca9966 commit 8ac6d33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion NppGZipFileViewer/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ private static void TryDecompress(ScNotification notification)


using var gzContentStream = NppGZipFileViewerHelper.GetContentStream(notification, path);


if (gzContentStream.Length == 0)
if (Preferences.HasGZipSuffix(path))
fileTracker.Include(notification.Header.IdFrom, path);
else return;
try
{
using var decodedContentStream = NppGZipFileViewerHelper.Decode(gzContentStream);
Expand Down
4 changes: 3 additions & 1 deletion NppGZipFileViewer/NppGZipFileViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AssemblyName>NppGZipFileViewer</AssemblyName>
<OutputPath>bin\Debug\</OutputPath>
<LangVersion>latest</LangVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
Expand Down Expand Up @@ -74,6 +74,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -84,6 +85,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion NppGZipFileViewer/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8ac6d33

Please sign in to comment.