Make sure empty files get text/plain type (#518720)
authorAlexander Larsson <alexl@redhat.com>
Fri, 29 Feb 2008 09:49:08 +0000 (09:49 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Fri, 29 Feb 2008 09:49:08 +0000 (09:49 +0000)
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

gio/ChangeLog
gio/glocalfileinfo.c

index 0a3435a9e254688ea61251b60f6a035fd1385295..af71aaa9c90d7d30d55649ce4ad0224f02e66503 100644 (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:
index 9c4538c11fb299c9a91d93ead7e1197170f14a65..4553ded1bcd0b556cc5880e372879220041045eb 100644 (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);