From 56d8ff97e4ed168a1c2f98daacf38f191241200d Mon Sep 17 00:00:00 2001 From: Rod Kay Date: Fri, 9 Aug 2024 21:16:27 +1000 Subject: [PATCH] lace.text.forge: Use Stream_IO instead of Text_IO when storing a string in a file to avoid the extra LF which Text_IO places at the end of a line when the file is closed. --- 1-base/lace/source/text/lace-text-forge.adb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/1-base/lace/source/text/lace-text-forge.adb b/1-base/lace/source/text/lace-text-forge.adb index d264a78..72d25e7 100644 --- a/1-base/lace/source/text/lace-text-forge.adb +++ b/1-base/lace/source/text/lace-text-forge.adb @@ -2,6 +2,7 @@ with ada.Characters.latin_1, ada.Directories, ada.Direct_IO, + ada.Streams.Stream_IO, ada.Text_IO; @@ -61,13 +62,15 @@ is procedure store (Filename : in forge.Filename; the_String : in String) is - use ada.Text_IO; + use ada.Streams.Stream_IO; File : File_type; + S : Stream_access; begin - create (File, out_File, String (Filename)); - put (File, the_String); - close (File); + create (File, out_File, String (Filename)); + S := Stream (File); + String'write (S, the_String); + close (File); end store;