Bug 660730: Use GStatBuf for portability
Thanks to Kean Johnston for pointing this out. There are a few places in GTK that use "struct stat", and then g_stat(), rather than using GStatBuf.This breaks things on Windows. Since the size of struct stat can vary depending on other flags specified, this has the potential to cause overwrites and is trivial to fix. Based on patch submitted by Kean Johnston
This commit is contained in:
		| @ -2037,7 +2037,7 @@ gboolean | ||||
| gtk_recent_info_exists (GtkRecentInfo *info) | ||||
| { | ||||
|   gchar *filename; | ||||
|   struct stat stat_buf; | ||||
|   GStatBuf stat_buf; | ||||
|   gboolean retval = FALSE; | ||||
|    | ||||
|   g_return_val_if_fail (info != NULL, FALSE); | ||||
| @ -2049,7 +2049,7 @@ gtk_recent_info_exists (GtkRecentInfo *info) | ||||
|   filename = g_filename_from_uri (info->uri, NULL, NULL); | ||||
|   if (filename) | ||||
|     { | ||||
|       if (stat (filename, &stat_buf) == 0) | ||||
|       if (g_stat (filename, &stat_buf) == 0) | ||||
|         retval = TRUE; | ||||
|       | ||||
|       g_free (filename); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Chun-wei Fan
					Chun-wei Fan