utils: use g_str_has_prefix() instead of prefixcmp()
Remove duplicated code from MPD.
This commit is contained in:
10
src/utils.c
10
src/utils.c
@@ -261,13 +261,3 @@ void xpthread_cond_destroy(pthread_cond_t *cond)
|
||||
if ((err = pthread_cond_destroy(cond)))
|
||||
FATAL("failed to destroy cond: %s\n", strerror(err));
|
||||
}
|
||||
|
||||
int prefixcmp(const char *str, const char *prefix)
|
||||
{
|
||||
for (; ; str++, prefix++)
|
||||
if (!*prefix)
|
||||
return 0;
|
||||
else if (*str != *prefix)
|
||||
return (unsigned char)*prefix - (unsigned char)*str;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user