Make sure empty files get text/plain type (#518720)

2008-02-29  Alexander Larsson  <alexl@redhat.com>

        * glocalfileinfo.c:
        (get_content_type):
	Make sure empty files get text/plain type (#518720)


svn path=/trunk/; revision=6605
This commit is contained in:
Alexander Larsson 2008-02-29 09:49:08 +00:00 committed by Alexander Larsson
parent 7d48fb3c81
commit 08c743202a
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-02-29 Alexander Larsson <alexl@redhat.com>
* glocalfileinfo.c:
(get_content_type):
Make sure empty files get text/plain type (#518720)
2008-02-27 Alexander Larsson <alexl@redhat.com>
* gcontenttype.c:

View File

@ -1215,7 +1215,7 @@ get_content_type (const char *basename,
res = read (fd, sniff_buffer, sniff_length);
close (fd);
if (res > 0)
if (res >= 0)
{
g_free (content_type);
content_type = g_content_type_guess (basename, sniff_buffer, res, NULL);