From: Wayne Davison Date: Thu, 22 Jan 2004 04:38:18 +0000 (+0000) Subject: Use the new f_name_to() calling syntax. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/3fef53645d0f05e126207cb49416248b6420f358 Use the new f_name_to() calling syntax. --- diff --git a/generator.c b/generator.c index 579ffc3d..a85567d5 100644 --- a/generator.c +++ b/generator.c @@ -561,8 +561,8 @@ void generate_files(int f, struct file_list *flist, char *local_name) file = © } - recv_generator(local_name? local_name - : f_name_to(file,fbuf,sizeof fbuf), file, i, f); + recv_generator(local_name ? local_name : f_name_to(file, fbuf), + file, i, f); } phase++; @@ -578,8 +578,8 @@ void generate_files(int f, struct file_list *flist, char *local_name) * to catch initial checksum errors */ while ((i = get_redo_num()) != -1) { struct file_struct *file = flist->files[i]; - recv_generator(local_name? local_name - : f_name_to(file,fbuf,sizeof fbuf), file, i, f); + recv_generator(local_name ? local_name : f_name_to(file, fbuf), + file, i, f); } phase++; diff --git a/hlink.c b/hlink.c index 40a7aa90..d5600d30 100644 --- a/hlink.c +++ b/hlink.c @@ -137,8 +137,8 @@ void do_hard_links(void) { #if SUPPORT_HARD_LINKS struct file_struct *file; - char fbuf[MAXPATHLEN]; - char *hlink1, *hlink2; + char hlink1[MAXPATHLEN]; + char *hlink2; STRUCT_STAT st1, st2; int i; @@ -147,8 +147,7 @@ void do_hard_links(void) for (i = 0; i < hlink_count; i++) { file = hlink_list[i]; - hlink1 = f_name_to(file, fbuf, sizeof fbuf); - if (link_stat(hlink1, &st1) != 0) + if (link_stat(f_name_to(file, hlink1), &st1) != 0) continue; while ((file = file->F_NEXT) != NULL) { hlink2 = f_name(file); diff --git a/receiver.c b/receiver.c index 246caea1..e2fd13bc 100644 --- a/receiver.c +++ b/receiver.c @@ -94,7 +94,7 @@ void delete_files(struct file_list *flist) if (!S_ISDIR(flist->files[j]->mode) || !(flist->files[j]->flags & FLAG_DELETE)) continue; - name = f_name_to(flist->files[j], fbuf, sizeof fbuf); + name = f_name_to(flist->files[j], fbuf); if (!(local_file_list = send_file_list(-1,1,&name))) continue; @@ -335,7 +335,7 @@ int recv_files(int f_in,struct file_list *flist,char *local_name) if (local_name) fname = local_name; else - fname = f_name_to(file, fbuf, sizeof fbuf); + fname = f_name_to(file, fbuf); if (dry_run) { if (!am_server && verbose) { /* log transfer */ @@ -486,8 +486,8 @@ int recv_files(int f_in,struct file_list *flist,char *local_name) for (i = 0; i < flist->count; i++) { file = flist->files[i]; if (!file->basename || !S_ISDIR(file->mode)) continue; - recv_generator(local_name? local_name - : f_name_to(file,fbuf,sizeof fbuf), file, i, -1); + recv_generator(local_name ? local_name : f_name_to(file, fbuf), + file, i, -1); } if (verbose > 2) diff --git a/sender.c b/sender.c index 8b649a8f..d103b9a2 100644 --- a/sender.c +++ b/sender.c @@ -130,7 +130,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) rprintf(FINFO, "send_files starting\n"); while (1) { - int offset = 0; + unsigned int offset; i = read_int(f_in); if (i == -1) { @@ -161,14 +161,9 @@ void send_files(struct file_list *flist, int f_out, int f_in) if (file->basedir) { offset = stringjoin(fname, sizeof fname, file->basedir, "/", NULL); - if (offset >= MAXPATHLEN-1) { - io_error |= IOERR_GENERAL; - rprintf(FERROR, "send_files failed on long-named directory %s\n", - full_fname(fname)); - return; - } - } - f_name_to(file, fname + offset, MAXPATHLEN - offset); + } else + offset = 0; + f_name_to(file, fname + offset); if (verbose > 2) rprintf(FINFO, "send_files(%d, %s)\n", i, fname);