@@ -473,11 +473,13 @@ package body Filter is
473473 Upper := False;
474474 else
475475 Result (K) := Characters.Handling.To_Lower (S (K));
476+
476477 if Result (K) = ' ' or else Result (K) = ' _' then
477478 Upper := True;
478479 end if ;
479480 end if ;
480481 end loop ;
482+
481483 return Result;
482484 end Capitalize ;
483485
@@ -528,6 +530,7 @@ package body Filter is
528530 Result (K) := ' ' ;
529531 end if ;
530532 end loop ;
533+
531534 return Result;
532535 end Clean_Text ;
533536
@@ -573,9 +576,7 @@ package body Filter is
573576 Check_Null_Parameter (P);
574577
575578 for K in S'Range loop
576-
577579 if S (K) = ' ' then
578-
579580 if Space = False then
580581 Space := True;
581582
@@ -641,14 +642,13 @@ package body Filter is
641642
642643 else
643644 declare
644- Pos : constant Natural := Strings.Fixed.Index (S, Param);
645+ Pos : constant Natural := Strings.Fixed.Index (S, Param);
645646 First, Last : Natural;
646647 begin
647648 if Pos < E
648649 or else
649650 (Pos + Len <= S'Last
650- and then S (Pos + Len) /= ' ='
651- and then S (Pos + Len) /= ' &' )
651+ and then S (Pos + Len) not in ' =' | ' &' )
652652 then
653653 -- The parameter is not present, return original string
654654 return S;
@@ -896,8 +896,10 @@ package body Filter is
896896 U := Filter_Map.Element (C);
897897 Unchecked_Free (U.CBT);
898898 end if ;
899+
899900 Filter_Map.Next (C);
900901 end loop ;
902+
901903 Filter_Map.Clear (User_Filters);
902904 end Free_Filters ;
903905
@@ -927,9 +929,12 @@ package body Filter is
927929
928930 else
929931 case P.Mode is
930- when Str => return ' (' & To_String (P.S) & ' )' ;
931- when Regexp => return ' (' & To_String (P.R_Str) & ' )' ;
932- when Regpat => return
932+ when Str =>
933+ return ' (' & To_String (P.S) & ' )' ;
934+ when Regexp =>
935+ return ' (' & To_String (P.R_Str) & ' )' ;
936+ when Regpat =>
937+ return
933938 ' (' & To_String (P.P_Str) & ' /' & To_String (P.Param) & ' )' ;
934939 when Slice =>
935940 return ' (' & Utils.Image (P.First)
@@ -1145,14 +1150,15 @@ package body Filter is
11451150
11461151 if Table (K).Name.all < Name then
11471152 F := K;
1153+
11481154 if F /= Mode'Last then
11491155 F := Mode'Succ (F);
11501156 end if ;
11511157
11521158 exit when Table (F).Name.all > Name;
1153-
11541159 else
11551160 L := K;
1161+
11561162 if L /= Mode'First then
11571163 L := Mode'Pred (L);
11581164 end if ;
@@ -1726,6 +1732,7 @@ package body Filter is
17261732 for K in S'Range loop
17271733 Result (Result'Last - K + Result'First) := S (K);
17281734 end loop ;
1735+
17291736 return Result;
17301737 end Reverse_Data ;
17311738
@@ -2078,8 +2085,8 @@ package body Filter is
20782085 else
20792086 -- There is only one word on the line: cut it
20802087
2081- Append (Result, S (First .. Last - 1 ) & ASCII.LF);
2082- First := Last;
2088+ Append (Result, S (First .. Last - 1 ) & ASCII.LF);
2089+ First := Last;
20832090 end if ;
20842091
20852092 Last_Space := Last_Space_Init;
0 commit comments