# HG changeset patch # User koda # Date 1277222815 -7200 # Node ID 51521238724fedc7cb6b42a47002e6017848eb09 # Parent 03892fb97ab3776ad21d906e12cdafed67474f3d ok really fix the command line utility diff -r 03892fb97ab3 -r 51521238724f hedgewars/uMisc.pas --- a/hedgewars/uMisc.pas Tue Jun 22 17:10:27 2010 +0200 +++ b/hedgewars/uMisc.pas Tue Jun 22 18:06:55 2010 +0200 @@ -776,14 +776,25 @@ Rewrite(f); {$ELSE} if (ParamStr(1) <> '') and (ParamStr(2) <> '') then - begin - for i:= 0 to 7 do + if (ParamCount <> 3) and (ParamCount <> 18) then begin - assign(f, ExtractFileDir(ParamStr(2)) + '/debug' + inttostr(i) + '.txt'); - rewrite(f); - if IOResult = 0 then break; - end; - if IOResult <> 0 then f:= stderr; // if everything fails, write to stderr + for i:= 0 to 7 do + begin + assign(f, ExtractFileDir(ParamStr(2)) + '/debug' + inttostr(i) + '.txt'); + rewrite(f); + if IOResult = 0 then break; + end; + if IOResult <> 0 then f:= stderr; // if everything fails, write to stderr + end + else + begin + for i:= 0 to 7 do + begin + assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt'); + rewrite(f); + if IOResult = 0 then break; + end; + if IOResult <> 0 then f:= stderr; // if everything fails, write to stderr end else f:= stderr;