aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/std
diff options
context:
space:
mode:
authorgingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2005-11-22 16:09:10 +0000
committergingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2005-11-22 16:09:10 +0000
commit171548c9d708fc13f5b6d3edde30630ee04bd06e (patch)
tree181c2a4f230ec445277ec4ed6a25c73f25aab3e2 /libraries/std
parent20e31a50417e5452dcc5797d27dc1383253e3161 (diff)
downloadghdl-171548c9d708fc13f5b6d3edde30630ee04bd06e.tar.gz
ghdl-171548c9d708fc13f5b6d3edde30630ee04bd06e.tar.bz2
ghdl-171548c9d708fc13f5b6d3edde30630ee04bd06e.zip
more optimizations + bug fixes
Diffstat (limited to 'libraries/std')
-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;