mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: GioGetMimeType function with zero size file
This commit is contained in:
parent
25aa9b6549
commit
2cefe63169
1 changed files with 5 additions and 1 deletions
|
|
@ -236,6 +236,7 @@ var
|
|||
Buffer: array of Byte;
|
||||
FileStream: TFileStreamEx;
|
||||
begin
|
||||
Result:= EmptyStr;
|
||||
// First check by file name (fast)
|
||||
MimeType:= g_content_type_guess(Pgchar(FileName), nil, 0, @Uncertain);
|
||||
if Assigned(MimeType) then
|
||||
|
|
@ -247,7 +248,10 @@ begin
|
|||
if Uncertain then
|
||||
begin
|
||||
if MaxExtent = 0 then
|
||||
Result:= 'text/plain'
|
||||
begin
|
||||
if Length(Result) = 0 then
|
||||
Result:= 'text/plain';
|
||||
end
|
||||
else begin
|
||||
SetLength(Buffer, MaxExtent);
|
||||
try
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue