aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/std/textio_body.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/std/textio_body.vhdl')
-rw-r--r--libraries/std/textio_body.vhdl6
1 files changed, 5 insertions, 1 deletions
diff --git a/libraries/std/textio_body.vhdl b/libraries/std/textio_body.vhdl
index 0362ef61a..cf81036a9 100644
--- a/libraries/std/textio_body.vhdl
+++ b/libraries/std/textio_body.vhdl
@@ -453,12 +453,16 @@ package body textio is
loop
untruncated_text_read (f, str, len);
exit when len = 0;
- if str (len) = LF then
+ if str (len) = LF or str (len) = CR then
-- LRM 14.3
-- The representation of the line does not contain the representation
-- of the end of the line.
is_eol := true;
len := len - 1;
+ -- End of line is any of LF/CR/CR+LF/LF+CR.
+ if len > 0 and (str (len) = LF or str (len) = CR) then
+ len := len - 1;
+ end if;
else
is_eol := false;
end if;