# HG changeset patch # User Richard Laager # Date 1154996719 0 # Node ID 44e1bf83dadff4622517a8bc1a41083cf32e2a66 # Parent 51f71ad82141d1ec8df15702a03c0191fa17053a [gaim-migrate @ 16668] We have gaim_str_has_prefix() to use in place of g_str_has_prefix(). committer: Tailor Script diff -r 51f71ad82141 -r 44e1bf83dadf src/protocols/bonjour/jabber.c --- a/src/protocols/bonjour/jabber.c Mon Aug 07 23:10:37 2006 +0000 +++ b/src/protocols/bonjour/jabber.c Tue Aug 08 00:25:19 2006 +0000 @@ -359,7 +359,7 @@ * using a magic string, but xmlnode won't play nice when just * parsing an end tag */ - if (g_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) { + if (gaim_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) { /* Close the socket, clear the watcher and free memory */ if (bb->conversation != NULL) { close(bb->conversation->socket); diff -r 51f71ad82141 -r 44e1bf83dadf src/protocols/qq/group_find.c --- a/src/protocols/qq/group_find.c Mon Aug 07 23:10:37 2006 +0000 +++ b/src/protocols/qq/group_find.c Tue Aug 08 00:25:19 2006 +0000 @@ -22,6 +22,7 @@ #include "conversation.h" #include "debug.h" +#include "util.h" #include "group_find.h" #include "group_network.h" @@ -39,7 +40,7 @@ /* if it starts with QQ_NAME_PREFIX, we think it is valid name already * otherwise we think it is nickname and try to find the matching gaim_name */ - if (g_str_has_prefix(who, QQ_NAME_PREFIX) && gaim_name_to_uid(who) > 0) + if (gaim_str_has_prefix(who, QQ_NAME_PREFIX) && gaim_name_to_uid(who) > 0) return (gchar *) who; group = qq_group_find_by_channel(gc, channel); diff -r 51f71ad82141 -r 44e1bf83dadf src/protocols/qq/utils.c --- a/src/protocols/qq/utils.c Mon Aug 07 23:10:37 2006 +0000 +++ b/src/protocols/qq/utils.c Tue Aug 08 00:25:19 2006 +0000 @@ -31,18 +31,11 @@ #include "char_conv.h" #include "debug.h" #include "prefs.h" +#include "util.h" #include "utils.h" #define QQ_NAME_FORMAT "qq-%d" -#if !GLIB_CHECK_VERSION(2, 1, 0) -gint g_str_has_prefix(const gchar *str, const gchar *prefix) -{ - gint len = strlen(prefix); - return !strncmp(str, prefix, len); -} -#endif - gchar *get_name_by_index_str(gchar **array, const gchar *index_str, gint amount) { gint index; @@ -160,7 +153,7 @@ { gchar *p; - g_return_val_if_fail(g_str_has_prefix(name, QQ_NAME_PREFIX), 0); + g_return_val_if_fail(gaim_str_has_prefix(name, QQ_NAME_PREFIX), 0); p = g_strrstr(name, QQ_NAME_PREFIX); return (p == NULL) ? 0 : strtol(p + strlen(QQ_NAME_PREFIX), NULL, 10);