Skip to content

Commit

Permalink
Fix #3064: Do not only match the full assembly name, but also try to …
Browse files Browse the repository at this point in the history
…match the filename when applying the "inassembly:" search filter.
  • Loading branch information
siegfriedpammer committed Oct 23, 2023
1 parent 807a50c commit ce891da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ICSharpCode.ILSpyX/Search/AbstractEntitySearchStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System;
using System.Collections.Concurrent;
using System.IO;

namespace ICSharpCode.ILSpyX.Search
{
Expand Down Expand Up @@ -66,7 +67,9 @@ protected bool IsInNamespaceOrAssembly(IEntity entity)
{
if (searchRequest.InAssembly != null)
{
if (entity.ParentModule == null || !entity.ParentModule.FullAssemblyName.Contains(searchRequest.InAssembly, StringComparison.OrdinalIgnoreCase))
if (entity.ParentModule?.PEFile == null ||
!(Path.GetFileName(entity.ParentModule.PEFile.FileName).Contains(searchRequest.InAssembly, StringComparison.OrdinalIgnoreCase)
|| entity.ParentModule.FullAssemblyName.Contains(searchRequest.InAssembly, StringComparison.OrdinalIgnoreCase)))
{
return false;
}
Expand Down

0 comments on commit ce891da

Please sign in to comment.