hedgewars/uUtils.pas
branchios-develop
changeset 13413 ba39a1d396c0
parent 13312 092adcf707c5
child 13844 94d0d1ab7a0e
--- a/hedgewars/uUtils.pas	Sun Jun 10 18:56:51 2018 +0200
+++ b/hedgewars/uUtils.pas	Sun Jun 10 19:12:26 2018 +0200
@@ -216,16 +216,12 @@
 SplitByChar(a,b,' ');
 end;
 
-// should this include "strtolower()" for the split string?
 procedure SplitByChar(var a, b: shortstring; c : char);
-var i, t: LongInt;
+var i: LongInt;
 begin
 i:= Pos(c, a);
 if i > 0 then
     begin
-    for t:= 1 to Pred(i) do
-        if (a[t] >= 'A')and(a[t] <= 'Z') then
-            Inc(a[t], 32);
     b:= copy(a, i + 1, Length(a) - i);
     a[0]:= char(Pred(i))
     {$IFDEF PAS2C}
@@ -755,9 +751,14 @@
 procedure freeModule;
 begin
 {$IFDEF DEBUGFILE}
+if logFile <> nil then
+    begin
     pfsWriteLn(logFile, 'halt at ' + inttostr(GameTicks) + ' ticks. TurnTimeLeft = ' + inttostr(TurnTimeLeft));
     pfsFlush(logFile);
     pfsClose(logFile);
+    end
+else
+    WriteLn(stdout, 'halt at ' + inttostr(GameTicks) + ' ticks. TurnTimeLeft = ' + inttostr(TurnTimeLeft));
 {$IFDEF USE_VIDEO_RECORDING}
     DoneCriticalSection(logMutex);
 {$ENDIF}