hedgewars/uMisc.pas
changeset 2796 7f86e7ad378b
parent 2753 2305bb5dc5f2
child 2797 98b990feec7d
--- a/hedgewars/uMisc.pas	Wed Feb 10 17:15:10 2010 +0000
+++ b/hedgewars/uMisc.pas	Wed Feb 10 17:31:12 2010 +0000
@@ -740,15 +740,9 @@
 	begin
 		assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt');
 		rewrite(f);
-		if IOResult = 5 then
-		begin
-			// prevent writing on a directory you do not have permissions on
-			// should be safe to assume the current directory is writable
-			assign(f, './debug' + inttostr(i) + '.txt');
-			rewrite(f);
-		end;
 		if IOResult = 0 then break;
 	end;
+	if IOResult <> 0 then f:= stderr; // if everything fails, write to stderr
 {$ENDIF}
 {$I+}
 {$ENDIF}