Skip to content

v3.3.3 breaks negative absolute patterns without a drive letter on Windows #486

@dylanwulf

Description

@dylanwulf

Description

The bugfix in #441 seems to have affected the way absolute negative patterns are treated on Windows. In v3.3.2, absolute negative patterns worked with or without a drive letter. In v3.3.3, absolute negative patterns do not work without a drive letter. I do not see anything in the documentation about requiring a drive letter for absolute paths in Windows, so I assume it should be ok to omit the drive letter in absolute paths. If my assumption is incorrect please let me know and I will close the issue.

Environment

OS: Windows 11
fast-glob: 3.3.3
Node: 22.14.0

Reproduction Code

const fg = require('fast-glob');

const options = { absolute: true };

const patternsWithDriveLetter = ['C:/Users/me/testfile.txt', '!C:/Users/me/testfile.txt'];
const patternsWithoutDriveLetter = ['/Users/me/testfile.txt', '!/Users/me/testfile.txt'];

console.log('with drive letter:', fg.sync(patternsWithDriveLetter, options));
console.log('without drive letter:', fg.sync(patternsWithoutDriveLetter, options));

Reproduction steps

  • Create file C:\Users\me\testfile.txt
  • Run the above code

Expected Result

This is how it worked in v3.3.2

with drive letter: []
without drive letter: []

Actual Result

This is how it works in v3.3.3

with drive letter: []
without drive letter: [ 'C:/Users/me/testfile.txt' ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions