Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec should clarify that slash must be escaped in brackets #499

Open
uap-universe opened this issue Feb 7, 2024 · 0 comments
Open

Spec should clarify that slash must be escaped in brackets #499

uap-universe opened this issue Feb 7, 2024 · 0 comments

Comments

@uap-universe
Copy link

The specification does not mention, that the slash character has to be escaped inside brackets to be treated as a single character.

There is special code in the reference implementation, for example editorconfig-core-c, that handles this case, so I do not believe that it's a bug in the implementation. The entire code looks 100% intentional.

The following example illustrates the issue:

pattern: "ab[e/]cd.i"

// matches only
"ab[e/]cd.i"

// does not match
"abecd.i"
"ab/cd.i"

On the other hand:

pattern: "ab[e\\/]cd.i"

// matches
"abecd.i"
"ab/cd.i"

// does not match
"ab\\cd.i"

Since the bracket-syntax is borrowed from regular expressions and the specification just says "every single character in seq", this looks totally wrong. But again, since the reference implementation looks very intentional, I think it's an oversight in the spec to clarify that path separators always have highest precedence and every other syntax is only to be applied to the individual parts of the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant