X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2Fenvvars.pas;h=a15feef0e1dc37e4cddde1038c004a390d33a92b;hb=refs%2Fheads%2Fmob;hp=5c60fd0d7c1adefe3508ebaf7f5d3cc948512820;hpb=ded89321df07e3f5832331127637375840c25e6f;p=d2df-sdl.git diff --git a/src/shared/envvars.pas b/src/shared/envvars.pas index 5c60fd0..a15feef 100644 --- a/src/shared/envvars.pas +++ b/src/shared/envvars.pas @@ -2,8 +2,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -64,14 +63,8 @@ end; {$ELSE} Result := ''; {$ENDIF} - (* invalidate username with non-cp1251 symbols *) - i := Low(Result); - while i <= High(Result) do - begin - if Result[i] = '?' then - Result := ''; - Inc(i) - end + // Remove non 1251 chars + Result := StringReplace(Result, Invalid1251Char, '', [rfReplaceAll]); end; end.