Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5
-
None
-
4b197c3f5 (dev)
Description
Dumping a few suspicious things that I've spotted in that function.
- The documentation https://doc.qt.io/qt-6/qregularexpression.html#wildcardToRegularExpression says :
The backslash () character is not an escape char in this context. In order to match one of the special characters, place it in square brackets (for example, [?]).
This is incorrect. glob(7) says
, and POSIX says https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13_01One can remove the special meaning of '?', '*' and '[' by preceding them by a backslash,
special characters can be escaped to remove their special meaning by preceding them with a <backslash> character
- A leading dot in a filename must not be matched by a * , a ? , a negated category class (e.g. [!x]) , a special category class (e.g. [[:punct:]]). We seem to ignore this issue entirely
- A slash (path separator) in a character class makes it NOT a character class:
, we seem instead to "bail out" and not consider this case accuratelyFor example, the pattern "a[b/c]d" does not match such pathnames as abd or a/d. It only matches a pathname of literally a[b/c]d