wok-6.x annotate libfm/stuff/empty-file.patch @ rev 17295
libfm: add support of empty files (empty files not a text and not a binary, its... empty)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Oct 30 01:21:22 2014 +0200 (2014-10-30) |
parents | |
children |
rev | line source |
---|---|
al@17295 | 1 --- src/base/fm-mime-type.c.orig |
al@17295 | 2 +++ src/base/fm-mime-type.c |
al@17295 | 3 @@ -156,10 +156,10 @@ |
al@17295 | 4 if(uncertain) |
al@17295 | 5 { |
al@17295 | 6 int fd, len; |
al@17295 | 7 - if(pstat->st_size == 0) /* empty file = text file with 0 characters in it. */ |
al@17295 | 8 + if(pstat->st_size == 0) /* empty file */ |
al@17295 | 9 { |
al@17295 | 10 g_free(type); |
al@17295 | 11 - return fm_mime_type_from_name("text/plain"); |
al@17295 | 12 + return fm_mime_type_from_name("application/x-zerosize"); |
al@17295 | 13 } |
al@17295 | 14 fd = open(file_path, O_RDONLY); |
al@17295 | 15 if(fd >= 0) |