[Issue 6888] New: std.getopt.getopt: one-letter hash option causes range violation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 3 08:48:35 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6888

           Summary: std.getopt.getopt: one-letter hash option causes range
                    violation
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: maximzms at gmail.com


--- Comment #0 from Maksim Zholudev <maximzms at gmail.com> 2011-11-03 08:48:03 PDT ---
The following code causes the error:
--------------------
import std.getopt;

void main()
{
    int[string] foo;
    auto args = ["", "-t", "a=1"];
    getopt(args, "t", &foo);
}
--------------------
core.exception.RangeError at std.getopt(519): Range violation
--------------------

There is no error if bundling is turned on:
getopt(args, config.bundling, "t", &foo);

There is no error if the option contains more than one letter
e.g. "--tune"

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list