Skip to content

Commit

Permalink
Update to change the fallback and fix gzip issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sinha-toyeesh authored and lukefromdc committed Jun 14, 2023
1 parent 5602738 commit 8e33e60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/file-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ gboolean
is_mime_type (const char *mime_type,
const char *pattern)
{
return (strcasecmp (mime_type, pattern) == 0);
return g_content_type_equals (mime_type, pattern);
}

const char*
Expand Down
4 changes: 2 additions & 2 deletions src/fr-archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,9 +1103,9 @@ load_local_archive (FrArchive *archive,
old_command = archive->command;

#if ENABLE_MAGIC
mime_type = get_mime_type_from_magic_numbers (archive->local_copy);
#else
mime_type = get_mime_type_from_filename (archive->local_copy);
#else
mime_type = get_mime_type_from_magic_numbers (archive->local_copy);
#endif

if (! create_command_to_load_archive (archive, mime_type)) {
Expand Down
6 changes: 3 additions & 3 deletions src/fr-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ fr_registered_command_get_capabilities (FrRegisteredCommand *reg_com,
FrMimeTypeCap *cap;

cap = g_ptr_array_index (reg_com->caps, i);
if (strcmp (mime_type, cap->mime_type) == 0)
if (is_mime_type (mime_type, cap->mime_type))
return cap->current_capabilities;
}

Expand All @@ -312,7 +312,7 @@ fr_registered_command_get_potential_capabilities (FrRegisteredCommand *reg_com,
FrMimeTypeCap *cap;

cap = g_ptr_array_index (reg_com->caps, i);
if ((cap->mime_type != NULL) && (strcmp (mime_type, cap->mime_type) == 0))
if ((cap->mime_type != NULL) && (is_mime_type (mime_type, cap->mime_type)))
return cap->potential_capabilities;
}

Expand Down Expand Up @@ -508,7 +508,7 @@ get_mime_type_index (const char *mime_type)
int i;

for (i = 0; mime_type_desc[i].mime_type != NULL; i++)
if (strcmp (mime_type_desc[i].mime_type, mime_type) == 0)
if (is_mime_type (mime_type_desc[i].mime_type, mime_type))
return i;
return -1;
}
Expand Down

0 comments on commit 8e33e60

Please sign in to comment.