February 18, 2011 [Issue 5610] New: std.getopt.getopt Access Violation | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=5610 Summary: std.getopt.getopt Access Violation Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody@puremagic.com ReportedBy: golovanov_alexey@mail.ru --- Comment #0 from Alexey G <golovanov_alexey@mail.ru> 2011-02-18 08:25:00 PST --- Created an attachment (id=917) smallest testcase program using std.getopt and started with non-english option (especially prepended by '-') crushes with error: object.Error: Access Violation. Environment: Windows XP SP3 DMD 2.052 Command line: getopt_test.exe -файл Output: object.Error: Access Violation -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 25, 2011 [Issue 5610] std.getopt.getopt Access Violation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alexey G | http://d.puremagic.com/issues/show_bug.cgi?id=5610 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |andrej.mitrovich@gmail.com Resolution| |INVALID --- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2011-05-24 19:24:35 PDT --- I'm testing this on v2.053. I suggest you upgrade to this version, it will give you nice stacktraces and a more useful error message. getopt only accepts a single argument with a single dash. You could pass a single unicode character if you want to e.g.: getopt_test.exe -ф And you'll get: getopt.d(411): Unrecognized option -ф which just means you have to write the code to handle such a case, but it works. Your multi-argument call will work if you prepend two dashes: import std.getopt; void main(string[] args) { bool test; getopt(args, "файл", &test); assert(test); } getopt_test.exe --файл So I'm closing this down, unless you find the bug persists. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation