Comment #0 by andrej.mitrovich — 2011-02-16T13:40:34Z
This is as odd as it gets. In Windows command-line:
> type math.d
module math;
import std.stdio;
import core.stdc.stdio;
import std.conv;
import std.string;
string prompt = "Enter a number: ";
int input;
void main()
{
write(prompt);
auto result = to!int(readln().strip);
writeln(result);
}
I run the test module via rdmd, and enter 45:
> rdmd math.d
D:\dev\code\d_code\bugs>Enter a number: 45
'45' is not recognized as an internal or external command,
operable program or batch file.
Now I thought I'm back to command line, but it appears I'm somehow still "in" rdmd mode:
D:\dev\code\d_code\bugs>test
std.conv.ConvException: std.conv(727): Can't convert value `test' of type const(char)[] to type int
std.conv.ConvException: std.conv(1129): Can't convert value `test' of type const(char)[] to type int
Finally I'm back to command line
>test
'test' is not recognized as an internal or external command,
operable program or batch file.
D:\dev\code\d_code\bugs>
Using DMD, this test module works fine:
> dmd math.d
> math.exe
Enter a number: 34
34
Comment #1 by bus_dbugzilla — 2011-05-21T17:13:40Z
This might be related to issue 4688
Comment #2 by andrei — 2011-05-22T06:20:37Z
I need the help of someone who has Windows to fix this bug. Please let me know, thanks!
Comment #3 by dlang-bugzilla — 2011-05-22T09:51:02Z
It looks like this was already fixed by Nick in git.
Comment #4 by andrej.mitrovich — 2011-05-22T11:01:00Z
Comment #5 by dlang-bugzilla — 2011-05-22T12:31:09Z
Created attachment 989
Patch to get from current git to compile
(In reply to comment #4)
> Unfortunately I can't get the latest rdmd.d from git to compile via 2.053 so I
> can't test if it's fixed or not.
> https://github.com/D-Programming-Language/tools/blob/master/rdmd.d
Andrei should push a patch for that shortly. Here's my version.
Comment #6 by andrej.mitrovich — 2011-05-22T22:53:54Z
Damn, it looks like Patch from the GnuWin32 project is incompatible with Patch distributed with git.
It does work with the one distributed with git:
D:\dev\projects\rdmd>"C:\Program Files\Git\Bin\patch.exe" -p1 < patchfile.patch
patching file `rdmd.d'
But I've tried with the GnuWin32 Patch before that and got this:
D:\dev\projects\rdmd>patch -p1 < patchfile.patch
patching file rdmd.d
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 339
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
2.5.9 seems to be the latest version too. Oh well..
On the flip side, I can't reproduce my bug anymore so it looks like Nick's patch fixed it. Also thanks for the compilation patch, Vlad!
*** This issue has been marked as a duplicate of issue 4688 ***