Mercurial > audlegacy
comparison src/audacious/playlist.c @ 3947:eb20411bb9e1
fixed bug in extension filtering function
author | mf0102 <0102@gmx.at> |
---|---|
date | Thu, 15 Nov 2007 21:25:25 +0100 |
parents | 0b93c2b0cd59 |
children | a575c29cee05 |
comparison
equal
deleted
inserted
replaced
3946:081a8ee0c0ae | 3947:eb20411bb9e1 |
---|---|
3475 gchar *tmp = g_filename_from_uri(uri, NULL, NULL); | 3475 gchar *tmp = g_filename_from_uri(uri, NULL, NULL); |
3476 gboolean rv; | 3476 gboolean rv; |
3477 | 3477 |
3478 filename = g_strdup(tmp ? tmp : uri); | 3478 filename = g_strdup(tmp ? tmp : uri); |
3479 g_free(tmp); | 3479 g_free(tmp); |
3480 | 3480 |
3481 base = g_path_get_basename(filename); | 3481 base = g_path_get_basename(filename); |
3482 ext = strrchr(base, '.'); | 3482 ext = g_strrstr(base, "."); |
3483 | |
3484 g_free(base); | |
3485 | 3483 |
3486 if(!ext) { | 3484 if(!ext) { |
3487 #if 0 | 3485 g_free(base); |
3488 if(g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { //allow a file without extension. | 3486 return FALSE; |
3489 g_print("no ext file\n"); | 3487 } |
3490 rv = TRUE; | 3488 |
3491 } | 3489 lext = g_utf8_strdown(ext+1, -1); |
3492 else | |
3493 rv = FALSE; | |
3494 #else | |
3495 rv = FALSE; //disallow. | |
3496 #endif | |
3497 return rv; | |
3498 } | |
3499 | |
3500 lext = g_ascii_strdown(ext+1, -1); | |
3501 | 3490 |
3502 if(g_hash_table_lookup(ext_hash, lext)) | 3491 if(g_hash_table_lookup(ext_hash, lext)) |
3503 rv = TRUE; | 3492 rv = TRUE; |
3504 else | 3493 else |
3505 rv = FALSE; | 3494 rv = FALSE; |
3506 | 3495 |
3507 g_free(lext); | 3496 g_free(lext); |
3497 g_free(base); | |
3508 return rv; | 3498 return rv; |
3509 } | 3499 } |