X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=libdocument%2Fev-file-helpers.c;h=edd4e4fd0adc2414e6918cab61dc7bceb4ce75e8;hb=aeadd8e191190c43e94999fef077ebea69e966c9;hp=6483e2d7b5964094dd99e9667e77d0037b165f1f;hpb=68c2072c87f150690e443de656b31746ac9383ad;p=evince.git diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c index 6483e2d7..edd4e4fd 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); } }