From f9005c63a79908eceb4f0d18e5ead648bea550f0 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 8 Jul 2012 21:28:53 +0200 Subject: [PATCH] Ensure folder existing when saving source --- midori/midori-view.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 870fbee1..bbdbf090 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -5457,9 +5457,11 @@ midori_view_save_source (MidoriView* view, if (!outfile) { gchar* extension = midori_view_get_uri_extension (uri); - unique_filename = g_strdup_printf ("%s/midori-%s/%uXXXXXX%s", - g_get_tmp_dir (), g_get_user_name (), + gchar* tmpdir = g_strdup_printf ("%s/midori-%s", g_get_tmp_dir (), g_get_user_name ()); + g_mkdir (tmpdir, 0700); + unique_filename = g_strdup_printf ("%s/%uXXXXXX%s", tmpdir, g_str_hash (uri), midori_view_fallback_extension (view, extension)); + g_free (tmpdir); g_free (extension); fd = g_mkstemp (unique_filename); } -- 2.39.5