summaryrefslogtreecommitdiffstats
path: root/gcc/ada/a-suteio.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-suteio.adb')
-rw-r--r--gcc/ada/a-suteio.adb10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ada/a-suteio.adb b/gcc/ada/a-suteio.adb
index 98034e2b110..ef01398a815 100644
--- a/gcc/ada/a-suteio.adb
+++ b/gcc/ada/a-suteio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -51,7 +51,9 @@ package body Ada.Strings.Unbounded.Text_IO is
Str1 := new String'(Buffer (1 .. Last));
while Last = Buffer'Last loop
Get_Line (Buffer, Last);
- Str2 := new String'(Str1.all & Buffer (1 .. Last));
+ Str2 := new String (1 .. Str1'Last + Last);
+ Str2 (Str1'Range) := Str1.all;
+ Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last);
Free (Str1);
Str1 := Str2;
end loop;
@@ -73,7 +75,9 @@ package body Ada.Strings.Unbounded.Text_IO is
Str1 := new String'(Buffer (1 .. Last));
while Last = Buffer'Last loop
Get_Line (File, Buffer, Last);
- Str2 := new String'(Str1.all & Buffer (1 .. Last));
+ Str2 := new String (1 .. Str1'Last + Last);
+ Str2 (Str1'Range) := Str1.all;
+ Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last);
Free (Str1);
Str1 := Str2;
end loop;
OpenPOWER on IntegriCloud