From 206499a39921d878660e35aa685745e37212e884 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Tue, 20 Mar 2012 06:29:25 +0100 Subject: [PATCH] Fixed CDC on Windows --- cdc.d | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cdc.d b/cdc.d index e037230..0d9e40a 100755 --- a/cdc.d +++ b/cdc.d @@ -241,6 +241,8 @@ void main(string[] args) try{build(targets);} catch(CompileException e){writeln("Could not compile: " ~ e.msg);} catch(ProcessException e){writeln("Compilation failed: " ~ e.msg);} + + writeln("DONE"); } ///Print help information. @@ -510,11 +512,11 @@ struct CompileOptions } version (Windows) { - //TODO needs testing - //{ if (find(this.out_file, ".") <= rfind(this.out_file, "/")) - if(out_file.find('.') <= out_file.retro().find('/').retro()) + auto dot = find(out_file, '.'); + auto backslash = retro(find(retro(out_file), '/')); + 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(" "); writeln("CDC: " ~ full); - if(int status = system(full) != 0) + if(int status = system(full ~ "\0") != 0) { throw new ProcessException("Process " ~ command ~ " exited with status " ~ to!string(status));