summaryrefslogtreecommitdiff
path: root/apps/filetypes.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/filetypes.c')
-rw-r--r--apps/filetypes.c9
1 files changed, 5 insertions, 4 deletions
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)
209} 209}
210 210
211/* get the "dynamic" attribute for an extension */ 211/* get the "dynamic" attribute for an extension */
212int filetype_get_attr(const char* name) 212int filetype_get_attr(char* name)
213{ 213{
214 int i; 214 int i;
215 char *cp;
215 216
216 for (i=0; i < cnt_exttypes; i++) 217 for (i=0; i < cnt_exttypes; i++)
217 { 218 {
218 if (exttypes[i].extension) 219 if (exttypes[i].extension)
219 { 220 {
220 if (!strcasecmp(&name[strlen(name)- 221 cp=strrchr(name,'.');
221 strlen(exttypes[i].extension)], 222 if (cp) cp++;
222 exttypes[i].extension)) 223 if ((!strcasecmp(cp,exttypes[i].extension)) && (cp))
223 { 224 {
224 return ((((unsigned long)exttypes[i].type - 225 return ((((unsigned long)exttypes[i].type -
225 (unsigned long)&filetypes[0]) / 226 (unsigned long)&filetypes[0]) /