[Issue 3371] New: regexp behavior in console and win32 are different
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 7 05:06:51 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3371
Summary: regexp behavior in console and win32 are different
Product: D
Version: 2.032
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: ldmc at yahoo.com
--- Comment #0 from bcosca <ldmc at yahoo.com> 2009-10-07 05:06:50 PDT ---
my win32 program has been driving me nuts until I realized that the following
code:
/* --- console code --- */
import std.regexp;
import std.stdio;
void main() {
auto r=search("abcdef","c");
writefln(r[0]);
}
/* --- end of console code --- */
outputs "c" on the console. but the following win32 equivalent:
/* --- windows code --- */
import core.runtime;
import std.regexp;
import std.c.windows.windows;
extern(Windows) void WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR
lpCmdLine,int nCmdShow) {
void exceptionHandler(Throwable e) {
throw e;
}
try {
Runtime.initialize(&exceptionHandler);
auto r=search("abcdef","c");
MessageBoxA(cast(HANDLE)0,cast(char*)r[0],"Alert",0);
Runtime.terminate(&exceptionHandler);
}
catch(Object o) {
MessageBoxA(cast(HANDLE)0,cast(LPSTR)o.toString(),"Alert",0);
}
}
/* --- end of windows code --- */
results in "cdef"! also, the compiled win32 program - without the exception
handling code - causes windows to crash.
--
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