From 52741663129845a55bf7beacd042e42932278839 Mon Sep 17 00:00:00 2001 From: gingold Date: Mon, 8 Jun 2009 02:02:20 +0000 Subject: Fix bug #13574, std.textio.read (string) bug --- libraries/std/textio_body.vhdl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libraries/std/textio_body.vhdl') diff --git a/libraries/std/textio_body.vhdl b/libraries/std/textio_body.vhdl index 1809adfc3..db0e7fe06 100644 --- a/libraries/std/textio_body.vhdl +++ b/libraries/std/textio_body.vhdl @@ -1305,9 +1305,17 @@ package body textio is return; end if; if l'left < l'right then + -- Ascending (expected common case). value := l (l'left to l'left + len - 1); trim (l, l'left + len); + elsif l'left = l'right then + -- String of 1 character. We don't know the direction and therefore + -- can't use the code below which does a slice. + value := l.all; + deallocate (l); + l := new string'(""); else + -- Descending. value := l (l'left downto l'left - len + 1); trim (l, l'left - len); end if; -- cgit v1.2.3