Stop SplitByChar also lowercasing the entire string. Fixes bug 581.
authorWuzzy <Wuzzy2@mail.ru>
Wed, 07 Mar 2018 15:09:31 +0100
changeset 13089 c9cdbf630447
parent 13088 2b5314cc356c
child 13090 3f3ad415d849
Stop SplitByChar also lowercasing the entire string. Fixes bug #581. It's weird that a function with this name would lowercase the whole string. Nemo and I have checked the history and code for any justifications of the lowercasing but we found none. I have checked in the code if anything actually depends on SplitByChar also lowercasing the string but I found nothing. It would surprise me since it's not obvious from the name IMO is bad coding practice anyway. Bug 581 is fixed by this because cLocale was (incorrectly) lowercased, which broke locale names like pt_BR to pt_br.
ChangeLog.txt
hedgewars/uUtils.pas
--- a/ChangeLog.txt	Wed Mar 07 13:48:51 2018 +0100
+++ b/ChangeLog.txt	Wed Mar 07 15:09:31 2018 +0100
@@ -15,6 +15,7 @@
  * Fix not displaying current volume status after pressing mute key
  * Fix many effects not being correctly recorded by the video recorder
  * Fix quit menu showing incorrect keys if using non-default key bindings
+ * Fix script translations not being loaded for Portuguese and Chinese
 
 Frontend:
  + Schemes are now stored in separate files under Schemes
--- a/hedgewars/uUtils.pas	Wed Mar 07 13:48:51 2018 +0100
+++ b/hedgewars/uUtils.pas	Wed Mar 07 15:09:31 2018 +0100
@@ -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}