Mercurial > pidgin
diff src/protocols/sametime/meanwhile/mw_util.c @ 12166:d6417efb990c
[gaim-migrate @ 14467]
g_str_has_prefix is only available in glib >= 2.2.0. we already have a
wrapper for this in gaim, but I guess it's not legitimate to use that in
meanwhile, so I duplicated the wrapper there too. code reuse at it's worst.
committer: Tailor Script <tailor@pidgin.im>
| author | Stu Tomlinson <stu@nosnilmot.com> |
|---|---|
| date | Sat, 19 Nov 2005 18:09:51 +0000 |
| parents | 3ef77720e577 |
| children | a2ebf585d8c6 |
line wrap: on
line diff
--- a/src/protocols/sametime/meanwhile/mw_util.c Sat Nov 19 18:07:19 2005 +0000 +++ b/src/protocols/sametime/meanwhile/mw_util.c Sat Nov 19 18:09:51 2005 +0000 @@ -78,3 +78,17 @@ mw_datum_clear(d); g_free(d); } + +gboolean +mw_str_has_prefix(const char *s, const char *p) +{ +#if GLIB_CHECK_VERSION(2,2,0) + return g_str_has_prefix(s, p); +#else + if (!strncmp(s, p, strlen(p))) + return TRUE; + + return FALSE; +#endif +} +
