diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-12-28 22:13:40 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-12-28 22:13:40 +0000 |
commit | e3cd198f8ea1ca022c222e7ed949658eaf6cddc9 (patch) | |
tree | de147d67acf359838274925252ddfec9d927a707 /hlink.c | |
parent | 5c36219d404da75b66d092e60f691acb3fee43c1 (diff) | |
download | rsync-e3cd198f8ea1ca022c222e7ed949658eaf6cddc9.tar.gz rsync-e3cd198f8ea1ca022c222e7ed949658eaf6cddc9.tar.bz2 rsync-e3cd198f8ea1ca022c222e7ed949658eaf6cddc9.zip |
- 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.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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 |