From 167ff0651a993e5f4e145cc92de2e86d64783220 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 27 Aug 2003 20:55:46 +0000 Subject: We need to unlink the full paths in the tmpdirs, not just the base path. 2003-08-27 Jeffrey Stedfast * e-mktemp.c (e_mktemp_cleanup): We need to unlink the full paths in the tmpdirs, not just the base path. svn path=/trunk/; revision=22391 --- e-util/e-mktemp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'e-util/e-mktemp.c') diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index baeb9d2577..10ac4e1bf6 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -131,12 +131,14 @@ e_mktemp_cleanup (void) dir = opendir (node->data); if (dir) { while ((dent = readdir (dir)) != NULL) { - /* yea...so if we contain - subdirectories this won't work, but - it shouldn't so we won't - bother caring... */ - if (strcmp (dent->d_name, ".") && strcmp (dent->d_name, "..")) - unlink (dent->d_name); + char *full_path; + + if (!strcmp (dent->d_name, ".") || !strcmp (dent->d_name, "..")) + continue; + + full_path = g_strdup_printf ("%s/%s", node->data, dent->d_name); + unlink (full_path); + g_free (full_path); } closedir (dir); } -- cgit v1.2.3