--- a/hedgewars/uMisc.pas Mon Jun 21 22:45:52 2010 +0200
+++ b/hedgewars/uMisc.pas Tue Jun 22 17:10:27 2010 +0200
@@ -170,7 +170,7 @@
{$ENDIF}
implementation
-uses Math, uConsole, uStore, uIO, uSound, typinfo;
+uses Math, uConsole, uStore, uIO, uSound, typinfo, sysutils;
var KBnum: Longword;
{$IFDEF DEBUGFILE}
@@ -775,11 +775,11 @@
Assign(f,'../Documents/debug.txt');
Rewrite(f);
{$ELSE}
- if ParamStr(1) <> '' then
+ if (ParamStr(1) <> '') and (ParamStr(2) <> '') then
begin
for i:= 0 to 7 do
begin
- assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt');
+ assign(f, ExtractFileDir(ParamStr(2)) + '/debug' + inttostr(i) + '.txt');
rewrite(f);
if IOResult = 0 then break;
end;