After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 54903 - Add non-initialized space to a GString
Add non-initialized space to a GString
Status: RESOLVED DUPLICATE of bug 52811
Product: glib
Classification: Platform
Component: general
1.3.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2001-05-18 16:54 UTC by Ron Steinke
Modified: 2011-02-18 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch described above (1.51 KB, patch)
2001-05-18 16:54 UTC, Ron Steinke
none Details | Review

Description Ron Steinke 2001-05-18 16:54:04 UTC
This patch allows g_string_[append,prepend,insert]_len
to take a NULL argument for the string and insert
uninitialized space into the string. This is useful,
e.g. in the new GIOChannel implementation (see bug 52811),
where GString is used as a buffer and read_raw (an
internal function) needs a character buffer to
read data into.
    This patch also modifies the
behavior of g_string_new_len to match the behavior
of the other functions. Previously, if passed a NULL,
g_string_new_len mimicked the behavior of
g_string_sized_new, making the (non user visible)
internal buffer of size len, but still making
the apparent length of the string zero. Now,
it makes the apparent length of the string
equal to len, but does not initialize the space.
    This change does not appear to affect the performance
of the code in the two locations that g_string_new_len
is called internally in glib, in gmarkup.c and
in gobject/gboxed.c.
Comment 1 Ron Steinke 2001-05-18 16:54:49 UTC
Created attachment 544 [details] [review]
patch described above
Comment 2 Ron Steinke 2001-06-27 21:30:12 UTC
    The code in this patch has been incorporated into
bug 52811 (the big GIOChannel patch).


*** This bug has been marked as a duplicate of 52811 ***