diff options
-rw-r--r-- | flist.c | 5 | ||||
-rw-r--r-- | hlink.c | 14 | ||||
-rw-r--r-- | main.c | 2 |
3 files changed, 10 insertions, 11 deletions
@@ -634,10 +634,9 @@ static void clean_fname(char *name) if (strncmp(p=name,"./",2) == 0) { modified = 1; - while (*p) { + do { p[0] = p[2]; - p++; - } + } while (*p++); } l = strlen(p=name); @@ -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 @@ -166,7 +166,7 @@ static void server_options(char **args,int *argc) -int do_cmd(char *cmd,char *machine,char *user,char *path,int *f_in,int *f_out) +static int do_cmd(char *cmd,char *machine,char *user,char *path,int *f_in,int *f_out) { char *args[100]; int i,argc=0, ret; |