[Xfce4-commits] <midori:master> Use mkdtemp correctly with absolute paths

Christian Dywan noreply at xfce.org
Fri Nov 16 20:08:02 CET 2012


Updating branch refs/heads/master
         to 99b5cf6357c45d3060504ecfdb3137d0a29cc194 (commit)
       from 1ccc87269bff076975151bd30453467ae7dbe26a (commit)

commit 99b5cf6357c45d3060504ecfdb3137d0a29cc194
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Nov 16 18:10:03 2012 +0100

    Use mkdtemp correctly with absolute paths

 tests/browser.c     |    2 +-
 tests/download.vala |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/browser.c b/tests/browser.c
index d10cfaf..d5da844 100644
--- a/tests/browser.c
+++ b/tests/browser.c
@@ -52,7 +52,7 @@ browser_create (void)
     view = midori_browser_get_nth_tab (browser, n);
 
     midori_test_set_dialog_response (GTK_RESPONSE_OK);
-    temporary_downloads = mkdtemp (g_strdup ("saveXXXXXX"));
+    temporary_downloads = mkdtemp (g_strconcat (g_get_tmp_dir (), "/saveXXXXXX", NULL));
     temporary_filename = g_build_filename (temporary_downloads, "test.html", NULL);
     midori_test_set_file_chooser_filename (temporary_filename);
     midori_settings_set_download_folder (MIDORI_SETTINGS (settings), temporary_downloads);
diff --git a/tests/download.vala b/tests/download.vala
index 4b3f530..5e380a7 100644
--- a/tests/download.vala
+++ b/tests/download.vala
@@ -39,7 +39,7 @@ static void download_extension () {
 }
 
 static void download_unique () {
-    string folder = "cacheXXXXXX"; DirUtils.mkdtemp (folder);
+    string folder = Environment.get_tmp_dir () + "/cacheXXXXXX"; DirUtils.mkdtemp (folder);
     string filename = Path.build_path (Path.DIR_SEPARATOR_S, folder, "foo.png");
     string org_filename = Path.build_path (Path.DIR_SEPARATOR_S, folder, "foo.png");
     string unique = Midori.Download.get_unique_filename (org_filename);


More information about the Xfce4-commits mailing list