From e86746f168529218742af51365155a5034c8f9c8 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Sun, 25 Oct 1998 06:44:49 +0000 Subject: [PATCH] no more characters are available if read() returns anything less than 1, Sun Oct 25 07:30:10 1998 Tim Janik * gscanner.c: (g_scanner_peek_next_char): (g_scanner_get_char): no more characters are available if read() returns anything less than 1, not only on 0 return. * glib.h: * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's argument order requirements. (g_strsplit): renamed from g_str_array_split(). (g_strjoinv): renamed from g_str_array_joinv(), string array is now passed as last parameter. removed `const' qualifier from string array pointer (again). (g_strjoin): new function from sopwith to concatenate strings with an additional seperator. (g_strfreev): renamed from g_str_array_free. --- ChangeLog | 18 ++++++++++++++++++ ChangeLog.pre-2-0 | 18 ++++++++++++++++++ ChangeLog.pre-2-10 | 18 ++++++++++++++++++ ChangeLog.pre-2-12 | 18 ++++++++++++++++++ ChangeLog.pre-2-2 | 18 ++++++++++++++++++ ChangeLog.pre-2-4 | 18 ++++++++++++++++++ ChangeLog.pre-2-6 | 18 ++++++++++++++++++ ChangeLog.pre-2-8 | 18 ++++++++++++++++++ glib.h | 18 +++++++++--------- glib/glib.h | 18 +++++++++--------- glib/gscanner.c | 4 ++-- glib/gstrfuncs.c | 16 ++++++++-------- gscanner.c | 4 ++-- gstrfuncs.c | 16 ++++++++-------- 14 files changed, 182 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03051be50..d506fd927 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +Sun Oct 25 07:30:10 1998 Tim Janik + + * gscanner.c: + (g_scanner_peek_next_char): + (g_scanner_get_char): no more characters are available if read() returns + anything less than 1, not only on 0 return. + + * glib.h: + * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's + argument order requirements. + (g_strsplit): renamed from g_str_array_split(). + (g_strjoinv): renamed from g_str_array_joinv(), string array is + now passed as last parameter. removed `const' qualifier from string + array pointer (again). + (g_strjoin): new function from sopwith to concatenate strings with + an additional seperator. + (g_strfreev): renamed from g_str_array_free. + Sat Oct 24 22:23:04 PDT 1998 Manish Singh * gnode.c: small fix to g_node_children_foreach to make it work right. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 03051be50..d506fd927 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,21 @@ +Sun Oct 25 07:30:10 1998 Tim Janik + + * gscanner.c: + (g_scanner_peek_next_char): + (g_scanner_get_char): no more characters are available if read() returns + anything less than 1, not only on 0 return. + + * glib.h: + * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's + argument order requirements. + (g_strsplit): renamed from g_str_array_split(). + (g_strjoinv): renamed from g_str_array_joinv(), string array is + now passed as last parameter. removed `const' qualifier from string + array pointer (again). + (g_strjoin): new function from sopwith to concatenate strings with + an additional seperator. + (g_strfreev): renamed from g_str_array_free. + Sat Oct 24 22:23:04 PDT 1998 Manish Singh * gnode.c: small fix to g_node_children_foreach to make it work right. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 03051be50..d506fd927 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,21 @@ +Sun Oct 25 07:30:10 1998 Tim Janik + + * gscanner.c: + (g_scanner_peek_next_char): + (g_scanner_get_char): no more characters are available if read() returns + anything less than 1, not only on 0 return. + + * glib.h: + * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's + argument order requirements. + (g_strsplit): renamed from g_str_array_split(). + (g_strjoinv): renamed from g_str_array_joinv(), string array is + now passed as last parameter. removed `const' qualifier from string + array pointer (again). + (g_strjoin): new function from sopwith to concatenate strings with + an additional seperator. + (g_strfreev): renamed from g_str_array_free. + Sat Oct 24 22:23:04 PDT 1998 Manish Singh * gnode.c: small fix to g_node_children_foreach to make it work right. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 03051be50..d506fd927 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,21 @@ +Sun Oct 25 07:30:10 1998 Tim Janik + + * gscanner.c: + (g_scanner_peek_next_char): + (g_scanner_get_char): no more characters are available if read() returns + anything less than 1, not only on 0 return. + + * glib.h: + * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's + argument order requirements. + (g_strsplit): renamed from g_str_array_split(). + (g_strjoinv): renamed from g_str_array_joinv(), string array is + now passed as last parameter. removed `const' qualifier from string + array pointer (again). + (g_strjoin): new function from sopwith to concatenate strings with + an additional seperator. + (g_strfreev): renamed from g_str_array_free. + Sat Oct 24 22:23:04 PDT 1998 Manish Singh * gnode.c: small fix to g_node_children_foreach to make it work right. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 03051be50..d506fd927 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,21 @@ +Sun Oct 25 07:30:10 1998 Tim Janik + + * gscanner.c: + (g_scanner_peek_next_char): + (g_scanner_get_char): no more characters are available if read() returns + anything less than 1, not only on 0 return. + + * glib.h: + * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's + argument order requirements. + (g_strsplit): renamed from g_str_array_split(). + (g_strjoinv): renamed from g_str_array_joinv(), string array is + now passed as last parameter. removed `const' qualifier from string + array pointer (again). + (g_strjoin): new function from sopwith to concatenate strings with + an additional seperator. + (g_strfreev): renamed from g_str_array_free. + Sat Oct 24 22:23:04 PDT 1998 Manish Singh * gnode.c: small fix to g_node_children_foreach to make it work right. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 03051be50..d506fd927 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,21 @@ +Sun Oct 25 07:30:10 1998 Tim Janik + + * gscanner.c: + (g_scanner_peek_next_char): + (g_scanner_get_char): no more characters are available if read() returns + anything less than 1, not only on 0 return. + + * glib.h: + * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's + argument order requirements. + (g_strsplit): renamed from g_str_array_split(). + (g_strjoinv): renamed from g_str_array_joinv(), string array is + now passed as last parameter. removed `const' qualifier from string + array pointer (again). + (g_strjoin): new function from sopwith to concatenate strings with + an additional seperator. + (g_strfreev): renamed from g_str_array_free. + Sat Oct 24 22:23:04 PDT 1998 Manish Singh * gnode.c: small fix to g_node_children_foreach to make it work right. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 03051be50..d506fd927 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,21 @@ +Sun Oct 25 07:30:10 1998 Tim Janik + + * gscanner.c: + (g_scanner_peek_next_char): + (g_scanner_get_char): no more characters are available if read() returns + anything less than 1, not only on 0 return. + + * glib.h: + * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's + argument order requirements. + (g_strsplit): renamed from g_str_array_split(). + (g_strjoinv): renamed from g_str_array_joinv(), string array is + now passed as last parameter. removed `const' qualifier from string + array pointer (again). + (g_strjoin): new function from sopwith to concatenate strings with + an additional seperator. + (g_strfreev): renamed from g_str_array_free. + Sat Oct 24 22:23:04 PDT 1998 Manish Singh * gnode.c: small fix to g_node_children_foreach to make it work right. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 03051be50..d506fd927 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,21 @@ +Sun Oct 25 07:30:10 1998 Tim Janik + + * gscanner.c: + (g_scanner_peek_next_char): + (g_scanner_get_char): no more characters are available if read() returns + anything less than 1, not only on 0 return. + + * glib.h: + * gstrfuncs.c: final API cleanup of string arrays to suit sopwith's + argument order requirements. + (g_strsplit): renamed from g_str_array_split(). + (g_strjoinv): renamed from g_str_array_joinv(), string array is + now passed as last parameter. removed `const' qualifier from string + array pointer (again). + (g_strjoin): new function from sopwith to concatenate strings with + an additional seperator. + (g_strfreev): renamed from g_str_array_free. + Sat Oct 24 22:23:04 PDT 1998 Manish Singh * gnode.c: small fix to g_node_children_foreach to make it work right. diff --git a/glib.h b/glib.h index c033b0afa..1468f5570 100644 --- a/glib.h +++ b/glib.h @@ -1373,22 +1373,22 @@ gchar* g_strnfill (guint length, gchar fill_char); gchar* g_strconcat (const gchar *string1, ...); /* NULL terminated */ +gchar* g_strjoin (const gchar *separator, + ...); /* NULL terminated */ /* NULL terminated string arrays. - * g_str_array_split() splits up string into max_tokens tokens at delim and + * g_strsplit() splits up string into max_tokens tokens at delim and * returns a newly allocated string array. - * g_str_array_joinv() concatenates all of str_array's strings, sliding in an + * g_strjoinv() concatenates all of str_array's strings, sliding in an * optional separator, the returned string is newly allocated. - * g_str_array_free() frees the array itself and all of its strings. + * g_strfreev() frees the array itself and all of its strings. */ -gchar** g_str_array_split (const gchar *string, +gchar** g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens); -gchar* g_str_array_joinv (const gchar *separator, - const gchar **str_array); -gchar* g_str_array_join (const gchar *separator, - ...); -void g_str_array_free (gchar **str_array); +gchar* g_strjoinv (const gchar *separator, + gchar **str_array); +void g_strfreev (gchar **str_array); diff --git a/glib/glib.h b/glib/glib.h index c033b0afa..1468f5570 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -1373,22 +1373,22 @@ gchar* g_strnfill (guint length, gchar fill_char); gchar* g_strconcat (const gchar *string1, ...); /* NULL terminated */ +gchar* g_strjoin (const gchar *separator, + ...); /* NULL terminated */ /* NULL terminated string arrays. - * g_str_array_split() splits up string into max_tokens tokens at delim and + * g_strsplit() splits up string into max_tokens tokens at delim and * returns a newly allocated string array. - * g_str_array_joinv() concatenates all of str_array's strings, sliding in an + * g_strjoinv() concatenates all of str_array's strings, sliding in an * optional separator, the returned string is newly allocated. - * g_str_array_free() frees the array itself and all of its strings. + * g_strfreev() frees the array itself and all of its strings. */ -gchar** g_str_array_split (const gchar *string, +gchar** g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens); -gchar* g_str_array_joinv (const gchar *separator, - const gchar **str_array); -gchar* g_str_array_join (const gchar *separator, - ...); -void g_str_array_free (gchar **str_array); +gchar* g_strjoinv (const gchar *separator, + gchar **str_array); +void g_strfreev (gchar **str_array); diff --git a/glib/gscanner.c b/glib/gscanner.c index 164cd9c8c..b73ca4c1b 100644 --- a/glib/gscanner.c +++ b/glib/gscanner.c @@ -711,7 +711,7 @@ g_scanner_peek_next_char (GScanner *scanner) } while (count == -1 && (errno == EINTR || errno == EAGAIN)); - if (!count) + if (count < 1) { scanner->input_fd = -1; @@ -750,7 +750,7 @@ g_scanner_get_char (GScanner *scanner, } while (count == -1 && (errno == EINTR || errno == EAGAIN)); - if (!count) + if (count < 1) { scanner->input_fd = -1; fchar = 0; diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index 776e99120..5b58c5446 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -1021,9 +1021,9 @@ g_strchomp (gchar *string) } gchar** -g_str_array_split (const gchar *string, - const gchar *delimiter, - gint max_tokens) +g_strsplit (const gchar *string, + const gchar *delimiter, + gint max_tokens) { GSList *string_list = NULL, *slist; gchar **str_array, *s; @@ -1076,7 +1076,7 @@ g_str_array_split (const gchar *string, } void -g_str_array_free (gchar **str_array) +g_strfreev (gchar **str_array) { if (str_array) { @@ -1090,8 +1090,8 @@ g_str_array_free (gchar **str_array) } gchar* -g_str_array_joinv (const gchar *separator, - const gchar **str_array) +g_strjoinv (const gchar *separator, + gchar **str_array) { gchar *string; @@ -1126,8 +1126,8 @@ g_str_array_joinv (const gchar *separator, } gchar* -g_str_array_join (const gchar *separator, - ...) +g_strjoin (const gchar *separator, + ...) { gchar *string, *s; va_list args; diff --git a/gscanner.c b/gscanner.c index 164cd9c8c..b73ca4c1b 100644 --- a/gscanner.c +++ b/gscanner.c @@ -711,7 +711,7 @@ g_scanner_peek_next_char (GScanner *scanner) } while (count == -1 && (errno == EINTR || errno == EAGAIN)); - if (!count) + if (count < 1) { scanner->input_fd = -1; @@ -750,7 +750,7 @@ g_scanner_get_char (GScanner *scanner, } while (count == -1 && (errno == EINTR || errno == EAGAIN)); - if (!count) + if (count < 1) { scanner->input_fd = -1; fchar = 0; diff --git a/gstrfuncs.c b/gstrfuncs.c index 776e99120..5b58c5446 100644 --- a/gstrfuncs.c +++ b/gstrfuncs.c @@ -1021,9 +1021,9 @@ g_strchomp (gchar *string) } gchar** -g_str_array_split (const gchar *string, - const gchar *delimiter, - gint max_tokens) +g_strsplit (const gchar *string, + const gchar *delimiter, + gint max_tokens) { GSList *string_list = NULL, *slist; gchar **str_array, *s; @@ -1076,7 +1076,7 @@ g_str_array_split (const gchar *string, } void -g_str_array_free (gchar **str_array) +g_strfreev (gchar **str_array) { if (str_array) { @@ -1090,8 +1090,8 @@ g_str_array_free (gchar **str_array) } gchar* -g_str_array_joinv (const gchar *separator, - const gchar **str_array) +g_strjoinv (const gchar *separator, + gchar **str_array) { gchar *string; @@ -1126,8 +1126,8 @@ g_str_array_joinv (const gchar *separator, } gchar* -g_str_array_join (const gchar *separator, - ...) +g_strjoin (const gchar *separator, + ...) { gchar *string, *s; va_list args;