* gstrfuncs.c (g_strescape): Backslashify also '"' characters.
* glib.h: Document g_strescape.
+1999-05-29 Tor Lillqvist <tml@iki.fi>
+
+ * gstrfuncs.c (g_strescape): Backslashify also '"' characters.
+
+ * glib.h: Document g_strescape.
+
1999-05-12 Tor Lillqvist <tml@iki.fi>
* glib.h (Win32): Map fileno to _fileno for mingw32. Map fstat to
_fstat.
- * README.win32: Advice also to remove -lmoldname from the
- patch to the egcs-1.1.2 spec file patch.
+ * README.win32: Advice also to remove -lmoldname in the
+ patch to the egcs-1.1.2 spec file.
Wed May 12 00:23:55 CDT 1999 Shawn T. Amundson <amundson@gtk.org>
+1999-05-29 Tor Lillqvist <tml@iki.fi>
+
+ * gstrfuncs.c (g_strescape): Backslashify also '"' characters.
+
+ * glib.h: Document g_strescape.
+
1999-05-12 Tor Lillqvist <tml@iki.fi>
* glib.h (Win32): Map fileno to _fileno for mingw32. Map fstat to
_fstat.
- * README.win32: Advice also to remove -lmoldname from the
- patch to the egcs-1.1.2 spec file patch.
+ * README.win32: Advice also to remove -lmoldname in the
+ patch to the egcs-1.1.2 spec file.
Wed May 12 00:23:55 CDT 1999 Shawn T. Amundson <amundson@gtk.org>
+1999-05-29 Tor Lillqvist <tml@iki.fi>
+
+ * gstrfuncs.c (g_strescape): Backslashify also '"' characters.
+
+ * glib.h: Document g_strescape.
+
1999-05-12 Tor Lillqvist <tml@iki.fi>
* glib.h (Win32): Map fileno to _fileno for mingw32. Map fstat to
_fstat.
- * README.win32: Advice also to remove -lmoldname from the
- patch to the egcs-1.1.2 spec file patch.
+ * README.win32: Advice also to remove -lmoldname in the
+ patch to the egcs-1.1.2 spec file.
Wed May 12 00:23:55 CDT 1999 Shawn T. Amundson <amundson@gtk.org>
+1999-05-29 Tor Lillqvist <tml@iki.fi>
+
+ * gstrfuncs.c (g_strescape): Backslashify also '"' characters.
+
+ * glib.h: Document g_strescape.
+
1999-05-12 Tor Lillqvist <tml@iki.fi>
* glib.h (Win32): Map fileno to _fileno for mingw32. Map fstat to
_fstat.
- * README.win32: Advice also to remove -lmoldname from the
- patch to the egcs-1.1.2 spec file patch.
+ * README.win32: Advice also to remove -lmoldname in the
+ patch to the egcs-1.1.2 spec file.
Wed May 12 00:23:55 CDT 1999 Shawn T. Amundson <amundson@gtk.org>
+1999-05-29 Tor Lillqvist <tml@iki.fi>
+
+ * gstrfuncs.c (g_strescape): Backslashify also '"' characters.
+
+ * glib.h: Document g_strescape.
+
1999-05-12 Tor Lillqvist <tml@iki.fi>
* glib.h (Win32): Map fileno to _fileno for mingw32. Map fstat to
_fstat.
- * README.win32: Advice also to remove -lmoldname from the
- patch to the egcs-1.1.2 spec file patch.
+ * README.win32: Advice also to remove -lmoldname in the
+ patch to the egcs-1.1.2 spec file.
Wed May 12 00:23:55 CDT 1999 Shawn T. Amundson <amundson@gtk.org>
+1999-05-29 Tor Lillqvist <tml@iki.fi>
+
+ * gstrfuncs.c (g_strescape): Backslashify also '"' characters.
+
+ * glib.h: Document g_strescape.
+
1999-05-12 Tor Lillqvist <tml@iki.fi>
* glib.h (Win32): Map fileno to _fileno for mingw32. Map fstat to
_fstat.
- * README.win32: Advice also to remove -lmoldname from the
- patch to the egcs-1.1.2 spec file patch.
+ * README.win32: Advice also to remove -lmoldname in the
+ patch to the egcs-1.1.2 spec file.
Wed May 12 00:23:55 CDT 1999 Shawn T. Amundson <amundson@gtk.org>
+1999-05-29 Tor Lillqvist <tml@iki.fi>
+
+ * gstrfuncs.c (g_strescape): Backslashify also '"' characters.
+
+ * glib.h: Document g_strescape.
+
1999-05-12 Tor Lillqvist <tml@iki.fi>
* glib.h (Win32): Map fileno to _fileno for mingw32. Map fstat to
_fstat.
- * README.win32: Advice also to remove -lmoldname from the
- patch to the egcs-1.1.2 spec file patch.
+ * README.win32: Advice also to remove -lmoldname in the
+ patch to the egcs-1.1.2 spec file.
Wed May 12 00:23:55 CDT 1999 Shawn T. Amundson <amundson@gtk.org>
+1999-05-29 Tor Lillqvist <tml@iki.fi>
+
+ * gstrfuncs.c (g_strescape): Backslashify also '"' characters.
+
+ * glib.h: Document g_strescape.
+
1999-05-12 Tor Lillqvist <tml@iki.fi>
* glib.h (Win32): Map fileno to _fileno for mingw32. Map fstat to
_fstat.
- * README.win32: Advice also to remove -lmoldname from the
- patch to the egcs-1.1.2 spec file patch.
+ * README.win32: Advice also to remove -lmoldname in the
+ patch to the egcs-1.1.2 spec file.
Wed May 12 00:23:55 CDT 1999 Shawn T. Amundson <amundson@gtk.org>
...); /* NULL terminated */
gchar* g_strjoin (const gchar *separator,
...); /* NULL terminated */
+/* Return a duplicate of the string with \ and " characters escaped by
+ * a \. The returned string should be freed with g_free().
+ */
gchar* g_strescape (gchar *string);
+
gpointer g_memdup (gconstpointer mem,
guint byte_size);
...); /* NULL terminated */
gchar* g_strjoin (const gchar *separator,
...); /* NULL terminated */
+/* Return a duplicate of the string with \ and " characters escaped by
+ * a \. The returned string should be freed with g_free().
+ */
gchar* g_strescape (gchar *string);
+
gpointer g_memdup (gconstpointer mem,
guint byte_size);
{
gchar *q;
gchar *escaped;
- guint backslashes = 0;
+ guint escapes_needed = 0;
gchar *p = string;
g_return_val_if_fail (string != NULL, NULL);
while (*p != '\000')
- backslashes += (*p++ == '\\');
+ {
+ escapes_needed += (*p == '\\' || *p == '"');
+ p++;
+ }
- if (!backslashes)
+ if (!escapes_needed)
return g_strdup (string);
- escaped = g_new (gchar, strlen (string) + backslashes + 1);
+ escaped = g_new (gchar, strlen (string) + escapes_needed + 1);
p = string;
q = escaped;
while (*p != '\000')
{
- if (*p == '\\')
+ if (*p == '\\' || *p == '"')
*q++ = '\\';
*q++ = *p++;
}
{
gchar *q;
gchar *escaped;
- guint backslashes = 0;
+ guint escapes_needed = 0;
gchar *p = string;
g_return_val_if_fail (string != NULL, NULL);
while (*p != '\000')
- backslashes += (*p++ == '\\');
+ {
+ escapes_needed += (*p == '\\' || *p == '"');
+ p++;
+ }
- if (!backslashes)
+ if (!escapes_needed)
return g_strdup (string);
- escaped = g_new (gchar, strlen (string) + backslashes + 1);
+ escaped = g_new (gchar, strlen (string) + escapes_needed + 1);
p = string;
q = escaped;
while (*p != '\000')
{
- if (*p == '\\')
+ if (*p == '\\' || *p == '"')
*q++ = '\\';
*q++ = *p++;
}