mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Determine mimetype
This commit is contained in:
parent
86e6e1cb86
commit
8952cf3e9f
1 changed files with 11 additions and 7 deletions
|
|
@ -123,14 +123,18 @@ begin
|
|||
begin
|
||||
cache := PMimeCache(caches[i]);
|
||||
mime_type := mime_cache_lookup_literal(cache, filename);
|
||||
if (mime_type = nil) then
|
||||
if Assigned(mime_type) then Exit(PAnsiChar(mime_type));
|
||||
end;
|
||||
|
||||
//* suffix matching */
|
||||
for i := 0 to caches.Count - 1 do
|
||||
begin
|
||||
cache := PMimeCache(caches[i]);
|
||||
type_suffix := mime_cache_lookup_suffix(cache, filename, @suffix_pos);
|
||||
if (type_suffix <> nil) and (suffix_pos < prev_suffix_pos) then
|
||||
begin
|
||||
type_suffix := mime_cache_lookup_suffix(cache, filename, @suffix_pos);
|
||||
if (type_suffix <> nil) and (suffix_pos < prev_suffix_pos) then
|
||||
begin
|
||||
mime_type := type_suffix;
|
||||
prev_suffix_pos := suffix_pos;
|
||||
end;
|
||||
mime_type := type_suffix;
|
||||
prev_suffix_pos := suffix_pos;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue