comparison src/util.c @ 7628:e293d0c42ccb

[gaim-migrate @ 8252] "Hi, my name is Gaim ... and I'm addicted to glib 2.0." committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Tue, 25 Nov 2003 03:30:59 +0000
parents 072feee65244
children ea2d07ad05a9
comparison
equal deleted inserted replaced
7627:dc88428762c9 7628:e293d0c42ccb
1530 gaim_strncpy_withhtml(dest, src, destsize); 1530 gaim_strncpy_withhtml(dest, src, destsize);
1531 1531
1532 return dest; 1532 return dest;
1533 } 1533 }
1534 1534
1535 gboolean
1536 gaim_str_has_prefix(const char *s, const char *p)
1537 {
1538 if (!strncmp(s, p, strlen(p)))
1539 return TRUE;
1540
1541 return FALSE;
1542 }
1543
1544 gboolean
1545 gaim_str_has_suffix(const char *s, const char *x)
1546 {
1547 int off = strlen(s) - strlen(x);
1548
1549 if (off >= 0 && !strcmp(s + off, x))
1550 return TRUE;
1551
1552 return FALSE;
1553 }
1554
1535 char * 1555 char *
1536 gaim_str_add_cr(const char *text) 1556 gaim_str_add_cr(const char *text)
1537 { 1557 {
1538 char *ret = NULL; 1558 char *ret = NULL;
1539 int count = 0, i, j; 1559 int count = 0, i, j;