aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-12-27 08:51:55 +0100
committerTristan Gingold <tgingold@free.fr>2022-12-31 13:54:48 +0100
commitd6343a0bf74d25973c5ed170b8e037b42bd08a7f (patch)
tree2c648bef7a098d5c588bb344ec93d759eab21a92
parent9521df67d938896f71c2ca284720b131879406d6 (diff)
downloadghdl-d6343a0bf74d25973c5ed170b8e037b42bd08a7f.tar.gz
ghdl-d6343a0bf74d25973c5ed170b8e037b42bd08a7f.tar.bz2
ghdl-d6343a0bf74d25973c5ed170b8e037b42bd08a7f.zip
grt-files_operations: allow last line without EOL
-rw-r--r--src/grt/grt-files_operations.adb5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/grt/grt-files_operations.adb b/src/grt/grt-files_operations.adb
index f2b408398..097165855 100644
--- a/src/grt/grt-files_operations.adb
+++ b/src/grt/grt-files_operations.adb
@@ -562,7 +562,10 @@ package body Grt.Files_Operations is
for I in 1 .. Len loop
C := fgetc (Stream);
if C < 0 then
- Status := Op_End_Of_File;
+ -- Return EOF only if no character has been read.
+ if L = 0 then
+ Status := Op_End_Of_File;
+ end if;
exit;
end if;
-- Be nice with DOS files: handle CR/CR+LF/LF.