summaryrefslogtreecommitdiff
path: root/hlink.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-12-28 22:13:40 +0000
committerAndrew Tridgell <tridge@samba.org>1997-12-28 22:13:40 +0000
commite3cd198f8ea1ca022c222e7ed949658eaf6cddc9 (patch)
treede147d67acf359838274925252ddfec9d927a707 /hlink.c
parent5c36219d404da75b66d092e60f691acb3fee43c1 (diff)
downloadrsync-e3cd198f8ea1ca022c222e7ed949658eaf6cddc9.tar.gz
- fixed spelling errors in man page
- fixed bug in hard link handling that could lead to spurious hard links. - fixed bug in the string handling in flist.c
Diffstat (limited to 'hlink.c')
-rw-r--r--hlink.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hlink.c b/hlink.c
index 495c0a86..b6e6f28d 100644
--- a/hlink.c
+++ b/hlink.c
@@ -73,12 +73,12 @@ int check_hard_link(struct file_struct *file)
{
#if SUPPORT_HARD_LINKS
int low=0,high=hlink_count-1;
- int mid=0,ret=0;
+ int ret=0;
if (!hlink_list || !S_ISREG(file->mode)) return 0;
while (low != high) {
- mid = (low+high)/2;
+ int mid = (low+high)/2;
ret = hlink_compare(&hlink_list[mid],file);
if (ret == 0) break;
if (ret > 0)
@@ -87,12 +87,12 @@ int check_hard_link(struct file_struct *file)
low=mid+1;
}
- if (hlink_compare(&hlink_list[mid],file) != 0) return 0;
+ if (hlink_compare(&hlink_list[low],file) != 0) return 0;
- if (mid > 0 &&
- S_ISREG(hlink_list[mid-1].mode) &&
- file->dev == hlink_list[mid-1].dev &&
- file->inode == hlink_list[mid-1].inode)
+ if (low > 0 &&
+ S_ISREG(hlink_list[low-1].mode) &&
+ file->dev == hlink_list[low-1].dev &&
+ file->inode == hlink_list[low-1].inode)
return 1;
#endif