Skip to content

Any glob without any globs returns forward slashes on Windows #76

@SnirBroshi

Description

@SnirBroshi

Usually and as per the documentation, input globs use forward slashes and the result paths use the native file separator.

But here are examples of globs on Windows which return forward slashes (a bug):

glob('C:/') //=> ['C:/']
glob('C:/Users') //=> ['C:/Users']
glob('/') //=> ['/']
glob('/Users') //=> ['/Users']
glob('./././') //=> ['./././']

Basically any glob which has no operators inside such as * or {} just returns the string as-is without any post-processing, even when it contains the wrong path separator. Note that the path must exist for it to not return zero results.

The result I expect is the same path I entered (not resolved or normalized or anything) just with the native path separator.

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