diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
index 30ea97b..895ea24 100644
--- a/gio/glocalfileinfo.c
+++ b/gio/glocalfileinfo.c
@@ -930,7 +930,7 @@ set_info_from_stat (GFileInfo             *info,
 #endif
 
   g_file_info_set_file_type (info, file_type);
-  g_file_info_set_size (info, statbuf->st_size);
+  g_file_info_set_size (info, ( (statbuf->st_blocks)?statbuf->st_size:0));
 
   _g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_UNIX_DEVICE, statbuf->st_dev);
 #ifndef G_OS_WIN32
