Bug 6634 – std.path.globMatch throws wrong assertion

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-09-09T03:28:00Z
Last change time
2011-10-08T14:57:32Z
Assigned to
nobody
Creator
r.sagitario

Comments

Comment #0 by r.sagitario — 2011-09-09T03:28:35Z
import std.path; void main() { globMatch("a.di", "*.d"); } asserts with [email protected](2239): Assertion failure The same happens when using fnmatch instead of globMatch. The problem is a wrong assert at the end of both functions: assert(ni >= path.length); The wrong assert has been there before, but was actually never executed because it was built into the runtime library in release mode only. Now that the functions are templates, code generation moved to the user project, so the asserts can actually trigger.
Comment #1 by braddr — 2011-09-17T17:16:28Z
Care to turn this into a pull request with a unittest?
Comment #2 by r.sagitario — 2011-09-19T22:53:22Z
Comment #3 by k.hara.pg — 2011-10-08T14:57:32Z