Bug 17574 – Range violation in std.getopt:getopt AA parsing

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-06-29T21:11:09Z
Last change time
2018-01-05T13:29:41Z
Assigned to
No Owner
Creator
briancschott

Comments

Comment #0 by briancschott — 2017-06-29T21:11:09Z
I discovered this while trying to figure out how to include commas in argument values: ``` import std.getopt; import std.stdio; void main() { string[string] mapping; arraySep = ","; string[] args = [ "testProgram", "-m", "a=b,c=\"d,e,f\"" ]; args.getopt("m", &mapping); writeln(mapping); } ```
Comment #1 by github-bugzilla — 2017-06-30T21:16:17Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/bb0340766b4810fd72f92d2a55981aba8006396e Fix issue 17574 - Avoid range error by checking the result of indexOf https://github.com/dlang/phobos/commit/700d44da1d104c03b5553cb9f636433b9be3434d Merge pull request #5525 from Hackerpilot/issue-17574 Fix issue 17574 - Avoid range error by checking the result of indexOf merged-on-behalf-of: H. S. Teoh <[email protected]>
Comment #2 by github-bugzilla — 2017-08-16T13:23:13Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/bb0340766b4810fd72f92d2a55981aba8006396e Fix issue 17574 - Avoid range error by checking the result of indexOf https://github.com/dlang/phobos/commit/700d44da1d104c03b5553cb9f636433b9be3434d Merge pull request #5525 from Hackerpilot/issue-17574
Comment #3 by github-bugzilla — 2018-01-05T13:29:41Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/bb0340766b4810fd72f92d2a55981aba8006396e Fix issue 17574 - Avoid range error by checking the result of indexOf https://github.com/dlang/phobos/commit/700d44da1d104c03b5553cb9f636433b9be3434d Merge pull request #5525 from Hackerpilot/issue-17574