Ensure folder existing when saving source
This commit is contained in:
parent
a0b2020550
commit
f9005c63a7
1 changed files with 4 additions and 2 deletions
|
@ -5457,9 +5457,11 @@ midori_view_save_source (MidoriView* view,
|
||||||
if (!outfile)
|
if (!outfile)
|
||||||
{
|
{
|
||||||
gchar* extension = midori_view_get_uri_extension (uri);
|
gchar* extension = midori_view_get_uri_extension (uri);
|
||||||
unique_filename = g_strdup_printf ("%s/midori-%s/%uXXXXXX%s",
|
gchar* tmpdir = g_strdup_printf ("%s/midori-%s", g_get_tmp_dir (), g_get_user_name ());
|
||||||
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_str_hash (uri), midori_view_fallback_extension (view, extension));
|
||||||
|
g_free (tmpdir);
|
||||||
g_free (extension);
|
g_free (extension);
|
||||||
fd = g_mkstemp (unique_filename);
|
fd = g_mkstemp (unique_filename);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue