Skip to content

Glob a/ matches the text a: U+E000 already in the text is read as a masked path separator #194

Open

Description

@matt-edmondson

What's wrong

Before calling DotNet.Glob, glob matching replaces / and \ with the private-use character U+E000, in both the pattern and the text (TextFilter/TextFilter.cs:441-450, MaskedPathSeparator / MaskPathSeparators / IsGlobMatch). The masking never escapes a U+E000 that the text already contains. That character then looks exactly like a masked separator:

  • IsMatch("a", "a/") (glob) returns true. Expected: false.
  • By the same mechanism, */* and **/ treat U+E000 as a separator, and an exclusion like -*/* hides items whose only "slash" is U+E000.

I checked the first case with a scratch MSTest against main at 5f420d9.

Why it matters

U+E000 is the first private-use code point, and icon fonts really use it (Nerd Fonts' Pomicons, for example, start at E000). ImGui-style UIs, which this library's filters serve, often embed icon glyphs in item labels. A label with such a glyph then matches or fails path-shaped globs depending on whether it has an icon.

Suggested fix

Make the mask unambiguous. Before masking, map any U+E000 already present in the pattern or text to a second private-use character that nothing else uses, so it only ever matches itself. Another way is to escape it in the pattern and substitute it in the text.

Open #175 ("Mask / and \ to different characters") changes the same function, so the two fixes could land together. Note that #175 is about / vs \, not about this aliasing.

Acceptance criteria

  • IsMatch("a", "a/") is false, and IsMatch("a", "a") is still true
  • Existing / and \ glob tests still pass

Activity

  1. matt-edmondson commented on Nov 6, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions