From b2473d58ab1a7ff0722bd27f08ce5a8856cd5502 Mon Sep 17 00:00:00 2001 From: Henrik Backe Date: Fri, 2 Sep 2005 15:05:35 +0000 Subject: Fixed associate problem with file extensions (.info files matched .nfo extension) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7456 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetypes.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'apps/filetypes.c') diff --git a/apps/filetypes.c b/apps/filetypes.c index ace89154fc..30ab2c34e5 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -209,17 +209,18 @@ bool filetype_supported(int attr) } /* get the "dynamic" attribute for an extension */ -int filetype_get_attr(const char* name) +int filetype_get_attr(char* name) { int i; + char *cp; for (i=0; i < cnt_exttypes; i++) { if (exttypes[i].extension) { - if (!strcasecmp(&name[strlen(name)- - strlen(exttypes[i].extension)], - exttypes[i].extension)) + cp=strrchr(name,'.'); + if (cp) cp++; + if ((!strcasecmp(cp,exttypes[i].extension)) && (cp)) { return ((((unsigned long)exttypes[i].type - (unsigned long)&filetypes[0]) / -- cgit v1.2.3