wok 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 | cce2b600b834 |
children | 8c0bb1fa7d90 |
files | libfm/receipt libfm/stuff/empty-file.patch |
line diff
1.1 --- a/libfm/receipt Thu Oct 30 01:16:39 2014 +0200 1.2 +++ b/libfm/receipt Thu Oct 30 01:21:22 2014 +0200 1.3 @@ -25,6 +25,8 @@ 1.4 # Rules to configure and make the package. 1.5 compile_rules() 1.6 { 1.7 + patch -p0 -i $stuff/empty-file.patch 1.8 + 1.9 ./configure \ 1.10 --sysconfdir=/etc \ 1.11 $CONFIGURE_ARGS &&
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/libfm/stuff/empty-file.patch Thu Oct 30 01:21:22 2014 +0200 2.3 @@ -0,0 +1,15 @@ 2.4 +--- src/base/fm-mime-type.c.orig 2.5 ++++ src/base/fm-mime-type.c 2.6 +@@ -156,10 +156,10 @@ 2.7 + if(uncertain) 2.8 + { 2.9 + int fd, len; 2.10 +- if(pstat->st_size == 0) /* empty file = text file with 0 characters in it. */ 2.11 ++ if(pstat->st_size == 0) /* empty file */ 2.12 + { 2.13 + g_free(type); 2.14 +- return fm_mime_type_from_name("text/plain"); 2.15 ++ return fm_mime_type_from_name("application/x-zerosize"); 2.16 + } 2.17 + fd = open(file_path, O_RDONLY); 2.18 + if(fd >= 0)