]> www.fi.muni.cz Git - evince.git/commitdiff
[libdocument] Fix borken ev_tmp_filename_unlink()
authorCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 4 May 2010 12:03:38 +0000 (14:03 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 4 May 2010 12:03:38 +0000 (14:03 +0200)
Check file is under evince tempdir rather than global tempdir and fix
the prefix check.

libdocument/ev-file-helpers.c

index 6483e2d7b5964094dd99e9667e77d0037b165f1f..edd4e4fd0adc2414e6918cab61dc7bceb4ce75e8 100644 (file)
@@ -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);
        }
 }