Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix hardlinks detection
Baptiste Daroussin committed 13 years ago
commit 86303b1d1fa65726834a76e2ecb4ba13014bac7c
parent 45777b5
1 file changed +11 -11
modified libpkg/utils.c
@@ -370,16 +370,16 @@ bool is_hardlink(struct hardlinks *hl, struct stat *st)
	size_t i;

	for (i = 0; i < hl->len; i++) {
-
		if (hl->inodes[i] == st->st_ino) {
-
			if (hl->cap <= hl->len) {
-
				hl->cap |= 1;
-
				hl->cap *= 2;
-
				hl->inodes = reallocf(hl->inodes,
-
						hl->cap * sizeof(ino_t));
-
			}
-
			hl->inodes[hl->len++] = st->st_ino;
-
			return false;
-
		}
+
		if (hl->inodes[i] == st->st_ino)
+
			return (false);
	}
-
	return true;
+
	if (hl->cap <= hl->len) {
+
		hl->cap |= 1;
+
		hl->cap *= 2;
+
		hl->inodes = reallocf(hl->inodes,
+
				hl->cap * sizeof(ino_t));
+
	}
+
	hl->inodes[hl->len++] = st->st_ino;
+

+
	return (true);
}