lace.text.forge: Rid 'CR' from line endings.

This commit is contained in:
Rod Kay
2022-08-16 14:30:18 +10:00
parent 9f32667aaf
commit 147b7ae4c4
2 changed files with 13 additions and 4 deletions

View File

@@ -22,8 +22,17 @@ is
while not end_of_File (the_File) while not end_of_File (the_File)
loop loop
append (Pad, get_Line (the_File) declare
& ada.Characters.Latin_1.LF); use ada.Characters;
Line : constant String := get_Line (the_File);
begin
if Line (Line'Last) = latin_1.CR
then
append (Pad, Line (Line'First .. Line'Last - 1) & latin_1.LF);
else
append (Pad, Line & latin_1.LF);
end if;
end;
end loop; end loop;
close (the_File); close (the_File);

View File

@@ -10,8 +10,8 @@ is
type Filename is new String; type Filename is new String;
function to_String (Filename : in forge.Filename) return String; function to_String (Filename : in forge.Filename) return String; -- Converts 'CR & LF' to 'LF' at the end of a line.
function to_Text (Filename : in forge.Filename) return Item; function to_Text (Filename : in forge.Filename) return Item; -- Converts 'CR & LF' to 'LF' at the end of a line.
-------------- --------------