Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/libdocument/ev-file-helpers.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-05-04 12:03:38 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2010-05-04 12:03:38 (GMT)
commitb4b43ea75d5b9f70b11a5f128f12e32e0c61bcb9 (patch)
treec7d1212b5bc2423cdf6619a415dc4eaf5fc2c6f9 /libdocument/ev-file-helpers.c
parent68c2072c87f150690e443de656b31746ac9383ad (diff)
[libdocument] Fix borken ev_tmp_filename_unlink()
Check file is under evince tempdir rather than global tempdir and fix the prefix check.
Diffstat (limited to 'libdocument/ev-file-helpers.c')
-rw-r--r--libdocument/ev-file-helpers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c
index 6483e2d..edd4e4f 100644
--- a/libdocument/ev-file-helpers.c
+++ b/libdocument/ev-file-helpers.c
@@ -319,13 +319,13 @@ ev_mkdtemp (const char *template,
void
ev_tmp_filename_unlink (const gchar *filename)
{
- const gchar *tempdir;
-
if (!filename)
return;
- tempdir = g_get_tmp_dir ();
- if (g_str_has_prefix (filename, tempdir) == 0) {
+ if (!tmp_dir)
+ return;
+
+ if (g_str_has_prefix (filename, tmp_dir)) {
g_unlink (filename);
}
}