mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-02 02:40:07 +02:00
When the string is ended by a delimiter, return an extra empty string just
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gstrfuncs.c (g_strsplit): When the string is ended by a delimiter, return an extra empty string just like for a delimiter at the start of the string. This makes the function behave more consitent and also fixes Bug #15026.
This commit is contained in:
parent
752f18cc24
commit
6f83e76ea8
@ -1,3 +1,10 @@
|
|||||||
|
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
|
* gstrfuncs.c (g_strsplit): When the string is ended by a
|
||||||
|
delimiter, return an extra empty string just like for a delimiter
|
||||||
|
at the start of the string. This makes the function behave more
|
||||||
|
consitent and also fixes Bug #15026.
|
||||||
|
|
||||||
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
* glib-object.h: added newly added gobject/ headers.
|
* glib-object.h: added newly added gobject/ headers.
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
|
* gstrfuncs.c (g_strsplit): When the string is ended by a
|
||||||
|
delimiter, return an extra empty string just like for a delimiter
|
||||||
|
at the start of the string. This makes the function behave more
|
||||||
|
consitent and also fixes Bug #15026.
|
||||||
|
|
||||||
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
* glib-object.h: added newly added gobject/ headers.
|
* glib-object.h: added newly added gobject/ headers.
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
|
* gstrfuncs.c (g_strsplit): When the string is ended by a
|
||||||
|
delimiter, return an extra empty string just like for a delimiter
|
||||||
|
at the start of the string. This makes the function behave more
|
||||||
|
consitent and also fixes Bug #15026.
|
||||||
|
|
||||||
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
* glib-object.h: added newly added gobject/ headers.
|
* glib-object.h: added newly added gobject/ headers.
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
|
* gstrfuncs.c (g_strsplit): When the string is ended by a
|
||||||
|
delimiter, return an extra empty string just like for a delimiter
|
||||||
|
at the start of the string. This makes the function behave more
|
||||||
|
consitent and also fixes Bug #15026.
|
||||||
|
|
||||||
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
* glib-object.h: added newly added gobject/ headers.
|
* glib-object.h: added newly added gobject/ headers.
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
|
* gstrfuncs.c (g_strsplit): When the string is ended by a
|
||||||
|
delimiter, return an extra empty string just like for a delimiter
|
||||||
|
at the start of the string. This makes the function behave more
|
||||||
|
consitent and also fixes Bug #15026.
|
||||||
|
|
||||||
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
* glib-object.h: added newly added gobject/ headers.
|
* glib-object.h: added newly added gobject/ headers.
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
|
* gstrfuncs.c (g_strsplit): When the string is ended by a
|
||||||
|
delimiter, return an extra empty string just like for a delimiter
|
||||||
|
at the start of the string. This makes the function behave more
|
||||||
|
consitent and also fixes Bug #15026.
|
||||||
|
|
||||||
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
* glib-object.h: added newly added gobject/ headers.
|
* glib-object.h: added newly added gobject/ headers.
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
|
* gstrfuncs.c (g_strsplit): When the string is ended by a
|
||||||
|
delimiter, return an extra empty string just like for a delimiter
|
||||||
|
at the start of the string. This makes the function behave more
|
||||||
|
consitent and also fixes Bug #15026.
|
||||||
|
|
||||||
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
* glib-object.h: added newly added gobject/ headers.
|
* glib-object.h: added newly added gobject/ headers.
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2000-10-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||||
|
|
||||||
|
* gstrfuncs.c (g_strsplit): When the string is ended by a
|
||||||
|
delimiter, return an extra empty string just like for a delimiter
|
||||||
|
at the start of the string. This makes the function behave more
|
||||||
|
consitent and also fixes Bug #15026.
|
||||||
|
|
||||||
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
Tue Oct 24 22:09:14 2000 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
* glib-object.h: added newly added gobject/ headers.
|
* glib-object.h: added newly added gobject/ headers.
|
||||||
|
@ -1487,7 +1487,7 @@ g_strsplit (const gchar *string,
|
|||||||
{
|
{
|
||||||
GSList *string_list = NULL, *slist;
|
GSList *string_list = NULL, *slist;
|
||||||
gchar **str_array, *s;
|
gchar **str_array, *s;
|
||||||
guint i, n = 1;
|
guint n = 1;
|
||||||
|
|
||||||
g_return_val_if_fail (string != NULL, NULL);
|
g_return_val_if_fail (string != NULL, NULL);
|
||||||
g_return_val_if_fail (delimiter != NULL, NULL);
|
g_return_val_if_fail (delimiter != NULL, NULL);
|
||||||
@ -1516,19 +1516,13 @@ g_strsplit (const gchar *string,
|
|||||||
}
|
}
|
||||||
while (--max_tokens && s);
|
while (--max_tokens && s);
|
||||||
}
|
}
|
||||||
if (*string)
|
string_list = g_slist_prepend (string_list, g_strdup (string));
|
||||||
{
|
|
||||||
n++;
|
|
||||||
string_list = g_slist_prepend (string_list, g_strdup (string));
|
|
||||||
}
|
|
||||||
|
|
||||||
str_array = g_new (gchar*, n);
|
str_array = g_new (gchar*, n + 1);
|
||||||
|
|
||||||
i = n - 1;
|
str_array[n--] = NULL;
|
||||||
|
|
||||||
str_array[i--] = NULL;
|
|
||||||
for (slist = string_list; slist; slist = slist->next)
|
for (slist = string_list; slist; slist = slist->next)
|
||||||
str_array[i--] = slist->data;
|
str_array[n--] = slist->data;
|
||||||
|
|
||||||
g_slist_free (string_list);
|
g_slist_free (string_list);
|
||||||
|
|
||||||
|
16
gstrfuncs.c
16
gstrfuncs.c
@ -1487,7 +1487,7 @@ g_strsplit (const gchar *string,
|
|||||||
{
|
{
|
||||||
GSList *string_list = NULL, *slist;
|
GSList *string_list = NULL, *slist;
|
||||||
gchar **str_array, *s;
|
gchar **str_array, *s;
|
||||||
guint i, n = 1;
|
guint n = 1;
|
||||||
|
|
||||||
g_return_val_if_fail (string != NULL, NULL);
|
g_return_val_if_fail (string != NULL, NULL);
|
||||||
g_return_val_if_fail (delimiter != NULL, NULL);
|
g_return_val_if_fail (delimiter != NULL, NULL);
|
||||||
@ -1516,19 +1516,13 @@ g_strsplit (const gchar *string,
|
|||||||
}
|
}
|
||||||
while (--max_tokens && s);
|
while (--max_tokens && s);
|
||||||
}
|
}
|
||||||
if (*string)
|
string_list = g_slist_prepend (string_list, g_strdup (string));
|
||||||
{
|
|
||||||
n++;
|
|
||||||
string_list = g_slist_prepend (string_list, g_strdup (string));
|
|
||||||
}
|
|
||||||
|
|
||||||
str_array = g_new (gchar*, n);
|
str_array = g_new (gchar*, n + 1);
|
||||||
|
|
||||||
i = n - 1;
|
str_array[n--] = NULL;
|
||||||
|
|
||||||
str_array[i--] = NULL;
|
|
||||||
for (slist = string_list; slist; slist = slist->next)
|
for (slist = string_list; slist; slist = slist->next)
|
||||||
str_array[i--] = slist->data;
|
str_array[n--] = slist->data;
|
||||||
|
|
||||||
g_slist_free (string_list);
|
g_slist_free (string_list);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user