Fixed CDC on Windows

This commit is contained in:
Ferdinand Majerech 2012-03-20 06:29:25 +01:00
parent 1a1783a228
commit 206499a399

12
cdc.d
View file

@ -241,6 +241,8 @@ void main(string[] args)
try{build(targets);} try{build(targets);}
catch(CompileException e){writeln("Could not compile: " ~ e.msg);} catch(CompileException e){writeln("Could not compile: " ~ e.msg);}
catch(ProcessException e){writeln("Compilation failed: " ~ e.msg);} catch(ProcessException e){writeln("Compilation failed: " ~ e.msg);}
writeln("DONE");
} }
///Print help information. ///Print help information.
@ -510,11 +512,11 @@ struct CompileOptions
} }
version (Windows) version (Windows)
{ {
//TODO needs testing auto dot = find(out_file, '.');
//{ if (find(this.out_file, ".") <= rfind(this.out_file, "/")) auto backslash = retro(find(retro(out_file), '/'));
if(out_file.find('.') <= out_file.retro().find('/').retro()) if(dot <= backslash)
{ {
out_file ~= bin_ext; out_file ~= bin_ext;
} }
} }
} }
@ -638,7 +640,7 @@ void execute(string command, string[] args)
string full = command ~ " " ~ args.join(" "); string full = command ~ " " ~ args.join(" ");
writeln("CDC: " ~ full); writeln("CDC: " ~ full);
if(int status = system(full) != 0) if(int status = system(full ~ "\0") != 0)
{ {
throw new ProcessException("Process " ~ command ~ " exited with status " ~ throw new ProcessException("Process " ~ command ~ " exited with status " ~
to!string(status)); to!string(status));