]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Only look for .tmp. in basename in traverse_fn
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 7 Jun 2010 21:19:22 +0000 (23:19 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 7 Jun 2010 21:19:22 +0000 (23:19 +0200)
cleanup.c

index cac014c44072ae9e299d6a9f9eee9caba71e4ca9..97f9f8ecce7eef1f4b17c0af1deca2a16ff7797a 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -96,7 +96,7 @@ static void traverse_fn(const char *fname, struct stat *st)
                return;
        }
 
-       if (strstr(fname, ".tmp.") != NULL) {
+       if (strstr(p, ".tmp.") != NULL) {
                /* delete any tmp files older than 1 hour */
                if (st->st_mtime + 3600 < time(NULL)) {
                        unlink(fname);
@@ -105,7 +105,6 @@ static void traverse_fn(const char *fname, struct stat *st)
                }
        }
 
-
        free(p);
 
        if (num_files == allocated) {