GKeyFile: Accept empty files
authorJürg Billeter <j@bitron.ch>
Fri, 4 Nov 2011 21:48:56 +0000 (22:48 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2011 04:11:41 +0000 (23:11 -0500)
It already accepts files consisting solely of whitespace.

https://bugzilla.gnome.org/show_bug.cgi?id=663432

glib/gkeyfile.c

index 20de0d8..dc4faf3 100644 (file)
@@ -766,14 +766,6 @@ g_key_file_load_from_fd (GKeyFile       *key_file,
       return FALSE;
     }
 
-  if (stat_buf.st_size == 0)
-    {
-      g_set_error_literal (error, G_KEY_FILE_ERROR,
-                           G_KEY_FILE_ERROR_PARSE,
-                           _("File is empty"));
-      return FALSE;
-    }
-
   if (key_file->approximate_size > 0)
     {
       g_key_file_clear (key_file);