Hmm, I was a tiny little bit wrong earlier.

I modified hedgewars a tiny bit (patch attached) and build in on
debomatic¹. You can see that the failing line reads:
"Lua test file specified: /<<PKGBUILDDIR>>/tests/lua/hellfire_burns.lua"

When I grep for the beginning of that line I get only one answer:
paul@ruapehu ~/tmp/packages/hedgewars $ rgrep "Lua test file specified" *
hedgewars/ArgParsers.pas:        {--lua-test}            35 : begin
cTestLua := true; SetSound(false); cScriptName :=
getstringParameter(arg, paramIndex, parseParameter); WriteLn(stdout,
'Lua test file specified: ' + cScriptName);end;

So it wasn't stderr, but stdout.

Anyways, it now fails for an access violation. I don't like this at all,
but it is hard to say if this is a fpc error or hedgewars'.

Paul

¹
http://debomatic-armhf.debian.net/distribution#unstable/hedgewars/0.9.22-dfsg-4+debug+elbrus/buildlog
Description: Writeln inside try/except statement
Author: Paul Gevers <elb...@debian.org>
X-Dgit-Generated: 0.9.22-dfsg-4+debug+elbrus 
ad588659e3d59e33080149b6ce14f2f6f64fd2de

---

--- hedgewars-0.9.22-dfsg.orig/hedgewars/uUtils.pas
+++ hedgewars-0.9.22-dfsg/hedgewars/uUtils.pas
@@ -464,7 +464,16 @@ end;
 
 procedure WriteLn(var f: textfile; s: shortstring);
 begin
-system.writeln(f, s)
+   {$I+}
+   try
+       system.writeln(f, s);
+   except
+       on E: EInOutError do
+   begin
+       system.writeln('File handling error occurred. Details: ', E.ClassName, 
'/', E.Message);
+       system.writeln(s);
+   end;
+   end
 end;
 
 function StrLength(s: PChar): Longword;

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to