summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2013-04-12 19:43:01 +0200
committerYorhel <git@yorhel.nl>2013-04-12 19:43:29 +0200
commitbc8ccc959d0a27f4a0eee7f7457f3d9cc2422ab7 (patch)
tree991bb80ca3c71b7b938495711078a440ce1eea7f
parent01f36e1bebbfbdd5d49ea7d10fdd4c8c57a52c36 (diff)
dir_scan.c: Reset directory sizes when excluded by a CACHEDIR.TAG
Tiny bug fix: The size of an excluded directory entry itself should not be counted, either. This is consistent with what you'd expect: A cache directory with thousands of files can easily take up several megabytes for the dir entry - but from the perspective of a backup system that recognizes cache dirs - the dir is empty, and therefore shouldn't take any extra space at all.
-rw-r--r--src/dir_scan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dir_scan.c b/src/dir_scan.c
index 57f96b3..2953421 100644
--- a/src/dir_scan.c
+++ b/src/dir_scan.c
@@ -197,8 +197,10 @@ static int dir_scan_item(struct dir *d) {
stat_to_dir(d, &st);
if(cachedir_tags && (d->flags & FF_DIR) && !(d->flags & (FF_ERR|FF_EXL|FF_OTHFS)))
- if(has_cachedir_tag(d->name))
+ if(has_cachedir_tag(d->name)) {
d->flags |= FF_EXL;
+ d->size = d->asize = 0;
+ }
/* Recurse into the dir or output the item */
if(d->flags & FF_DIR && !(d->flags & (FF_ERR|FF_EXL|FF_OTHFS)))