Skip to content

Commit

Permalink
glob() cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmisek committed Jun 13, 2024
1 parent 2ecfe50 commit 2459513
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Peachpie.Library/FileSystem.Glob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,9 @@ private void TestPath(string path, int patternEnd, bool isLastPathSegment)

int pos = 0;
string baseDirectory = ".";
if (_pattern[0] == '/' || (_pattern.Length >= 2 && _pattern[1] == ':'))//is pattern rooted?
if (Path.IsPathRooted(_pattern))
{
bool containsWildcard;
pos = FindNextSeparator(0, false, out containsWildcard);
pos = FindNextSeparator(0, false, out var containsWildcard);
if (pos == _pattern.Length)
{
TestPath(_pattern, pos, true);
Expand Down

0 comments on commit 2459513

Please sign in to comment.