* If a new file is noticed by inotify, check if it is cover art for existing files, and update them if so.

This commit is contained in:
Justin Maggard
2009-07-08 19:20:32 +00:00
parent 038356bf78
commit b1f4c35017
5 changed files with 95 additions and 4 deletions

11
utils.c
View File

@ -31,8 +31,15 @@
int
ends_with(const char * haystack, const char * needle)
{
const char * end = strrchr(haystack, *needle);
return (strcasecmp(end?end:"", needle) ? 0 : 1);
const char * end;
int nlen = strlen(needle);
int hlen = strlen(haystack);
if( nlen > hlen )
return 0;
end = haystack + hlen - nlen;
return (strcasecmp(end, needle) ? 0 : 1);
}
char *