From e4860acb5815d245c00554367d6ffcd18a7523b7 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Thu, 3 Jan 2013 15:02:00 +0100 Subject: [PATCH] screenshot: use g_file_replace() when using an absolute path Instead of g_file_create(), which always fails if the file exists already. --- src/shell-screenshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c index 4078ccd56..2914e0705 100644 --- a/src/shell-screenshot.c +++ b/src/shell-screenshot.c @@ -153,7 +153,7 @@ prepare_write_stream (const gchar *filename, { file = g_file_new_for_path (filename); *filename_used = g_strdup (filename); - stream = G_OUTPUT_STREAM (g_file_create (file, G_FILE_CREATE_NONE, NULL, NULL)); + stream = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL)); g_object_unref (file); } else