mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 09:19:32 +02:00
IDE: custom options in makefile: combine linebreaks to single spaces
git-svn-id: trunk@29471 -
This commit is contained in:
parent
d94246f616
commit
d1da1d5e40
@ -1662,8 +1662,23 @@ end;
|
||||
function SpecialCharsToSpaces(const s: string; FixUTF8: boolean): string;
|
||||
var
|
||||
i: Integer;
|
||||
p: LongInt;
|
||||
begin
|
||||
Result:=s;
|
||||
// convert line breaks to single spaces
|
||||
i:=length(Result);
|
||||
while (i>=1) do begin
|
||||
if Result[i] in [#10,#13] then begin
|
||||
Result[i]:=' ';
|
||||
p:=i;
|
||||
while (i>1) and (Result[i-1] in [#10,#13]) do dec(i);
|
||||
if p>i then
|
||||
System.Delete(Result,i,p-i);
|
||||
end;
|
||||
dec(i);
|
||||
end;
|
||||
|
||||
// convert special characters to spaces
|
||||
for i:=1 to length(Result) do
|
||||
if Result[i] in [#0..#31,#127] then Result[i]:=' ';
|
||||
if Result='' then exit;
|
||||
|
Loading…
Reference in New Issue
Block a user