aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-mktemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-mktemp.c')
-rw-r--r--e-util/e-mktemp.c14
1 files changed, 8 insertions, 6 deletions
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);
}