]>
Commit | Line | Data |
---|---|---|
36829a82 AM |
1 | =================================================================== |
2 | RCS file: /cvs/gcc/gcc/gcc/ada/a-stunau.adb,v | |
3 | retrieving revision 1.5 | |
4 | retrieving revision 1.6 | |
5 | diff -u -r1.5 -r1.6 | |
6 | --- gcc/gcc/ada/a-stunau.adb 2003/10/21 13:41:54 1.5 | |
7 | +++ gcc/gcc/ada/a-stunau.adb 2005/01/18 22:00:12 1.6 | |
8 | @@ -48,16 +48,18 @@ | |
9 | ||
10 | U_Ptr : constant Unbounded_String_Access := U'Unrestricted_Access; | |
11 | -- Unbounded_String is a controlled type which is always passed | |
12 | - -- by copy it is always safe to take the pointer to such object | |
13 | - -- here. This pointer is used to set the U.Reference value which | |
14 | - -- would not be possible otherwise as U is read-only. | |
15 | + -- by reference. It is always safe to take the pointer to such | |
16 | + -- object here. This pointer is used to set the U.Reference | |
17 | + -- value which would not be possible otherwise as U is read-only. | |
18 | ||
19 | Old : String_Access := U.Reference; | |
20 | + Ret : String_Access; | |
21 | ||
22 | begin | |
23 | - U_Ptr.Reference := new String'(U.Reference (1 .. U.Last)); | |
24 | + Ret := new String'(U.Reference (1 .. U.Last)); | |
25 | + U_Ptr.Reference := Ret; | |
26 | Free (Old); | |
27 | - return U.Reference; | |
28 | + return Ret; | |
29 | end; | |
30 | end if; | |
31 | end Get_String; |