* 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:
11
utils.c
11
utils.c
@ -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 *
|
||||
|
Reference in New Issue
Block a user