summarylogtreecommitdiffstats
path: root/tmp-as-temp.patch
diff options
context:
space:
mode:
Diffstat (limited to 'tmp-as-temp.patch')
-rw-r--r--tmp-as-temp.patch85
1 files changed, 0 insertions, 85 deletions
diff --git a/tmp-as-temp.patch b/tmp-as-temp.patch
deleted file mode 100644
index e2e788a5b737..000000000000
--- a/tmp-as-temp.patch
+++ /dev/null
@@ -1,85 +0,0 @@
---- src/file-utils.c 2017-05-02 14:13:27.327758724 +0200
-+++ src/file-utils.c 2017-05-02 14:26:07.501244763 +0200
-@@ -51,27 +51,6 @@
-
- /* path */
-
--
--static const char *try_folder[] = { "cache", "~", "tmp", NULL };
--
--
--static const char *
--get_nth_temp_folder_to_try (int n)
--{
-- const char *folder;
--
-- folder = try_folder[n];
-- if (strcmp (folder, "cache") == 0)
-- folder = g_get_user_cache_dir ();
-- else if (strcmp (folder, "~") == 0)
-- folder = g_get_home_dir ();
-- else if (strcmp (folder, "tmp") == 0)
-- folder = g_get_tmp_dir ();
--
-- return folder;
--}
--
--
- char *
- _g_path_get_temp_work_dir (const char *parent_folder)
- {
-@@ -81,28 +60,7 @@
- char *template;
- char *result = NULL;
-
-- if (parent_folder == NULL) {
-- /* find the folder with more free space. */
--
-- for (i = 0; try_folder[i] != NULL; i++) {
-- const char *folder;
-- GFile *file;
-- guint64 size;
--
-- folder = get_nth_temp_folder_to_try (i);
-- file = g_file_new_for_path (folder);
-- size = _g_file_get_free_space (file);
-- g_object_unref (file);
--
-- if (max_size < size) {
-- max_size = size;
-- g_free (best_folder);
-- best_folder = g_strdup (folder);
-- }
-- }
-- }
-- else
-- best_folder = g_strdup (parent_folder);
-+ best_folder = g_strdup (g_get_tmp_dir ());
-
- if (best_folder == NULL)
- return NULL;
-@@ -578,17 +536,15 @@
- return FALSE;
- }
-
-- for (i = 0; try_folder[i] != NULL; i++) {
-- const char *folder;
-
-- folder = get_nth_temp_folder_to_try (i);
-- if (strncmp (path, folder, strlen (folder)) == 0) {
-- if (strncmp (path + strlen (folder), "/.fr-", 5) == 0) {
-- result = TRUE;
-- break;
-- }
-+ const char *folder;
-+
-+ folder = g_strdup (g_get_tmp_dir ());
-+ if (strncmp (path, folder, strlen (folder)) == 0) {
-+ if (strncmp (path + strlen (folder), "/.fr-", 5) == 0) {
-+ result = TRUE;
- }
-- }
-+ }
-
- g_free (path);
-