[evince/gnome-2-30] [libdocument] Fix broken ev_tmp_filename_unlink()
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/gnome-2-30] [libdocument] Fix broken ev_tmp_filename_unlink()
- Date: Tue, 4 May 2010 18:39:36 +0000 (UTC)
commit 8ad5fbe790732ac9220c1d67296b2bbb1bffbe26
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Tue May 4 14:03:38 2010 +0200
[libdocument] Fix broken ev_tmp_filename_unlink()
Check file is under evince tempdir rather than global tempdir and fix
the prefix check.
libdocument/ev-file-helpers.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c
index 09890d7..86d8e72 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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]