mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 05:43:28 +02:00
glib.h the #define for g_strescape interfered with the compilation of the
* glib.h * gstrfuncs.c: the #define for g_strescape interfered with the compilation of the function, so just remove the function and note that it's deprecated in the header -Yosh
This commit is contained in:
@@ -1188,9 +1188,9 @@ g_strecpy (gchar *dest,
|
||||
if ((*p < ' ') || (*p >= 0177))
|
||||
{
|
||||
*q++ = '\\';
|
||||
*q++ = '0' + (((*p) >> 6)&07);
|
||||
*q++ = '0' + (((*p) >> 3)&07);
|
||||
*q++ = '0' + ((*p)&07);
|
||||
*q++ = '0' + (((*p) >> 6) & 07);
|
||||
*q++ = '0' + (((*p) >> 3) & 07);
|
||||
*q++ = '0' + ((*p) & 07);
|
||||
}
|
||||
else
|
||||
*q++ = *p;
|
||||
@@ -1203,43 +1203,6 @@ g_strecpy (gchar *dest,
|
||||
return dest;
|
||||
}
|
||||
|
||||
gchar*
|
||||
g_strescape (gchar *string)
|
||||
{
|
||||
gchar *q;
|
||||
gchar *escaped;
|
||||
guint escapes_needed = 0;
|
||||
gchar *p = string;
|
||||
|
||||
g_message ("g_strescape() is deprecated");
|
||||
|
||||
g_return_val_if_fail (string != NULL, NULL);
|
||||
|
||||
while (*p != '\000')
|
||||
{
|
||||
escapes_needed += (*p == '\\' || *p == '"');
|
||||
p++;
|
||||
}
|
||||
|
||||
if (!escapes_needed)
|
||||
return g_strdup (string);
|
||||
|
||||
escaped = g_new (gchar, strlen (string) + escapes_needed + 1);
|
||||
|
||||
p = string;
|
||||
q = escaped;
|
||||
|
||||
while (*p != '\000')
|
||||
{
|
||||
if (*p == '\\' || *p == '"')
|
||||
*q++ = '\\';
|
||||
*q++ = *p++;
|
||||
}
|
||||
*q = '\000';
|
||||
|
||||
return escaped;
|
||||
}
|
||||
|
||||
/* blame Elliot for these next five routines */
|
||||
gchar*
|
||||
g_strchug (gchar *string)
|
||||
|
Reference in New Issue
Block a user