wrong point
- fixed a seg fault error in flist.c
- only print hlink debug messages when using -v
strncpy(fname,dir,MAXPATHLEN-1);
fname[MAXPATHLEN-1]=0;
l = strlen(fname);
strncpy(fname,dir,MAXPATHLEN-1);
fname[MAXPATHLEN-1]=0;
l = strlen(fname);
- if (fname[l-1] != '/')
- strcat(fname,"/");
+ if (fname[l-1] != '/') {
+ strcat(fname,"/");
+ l++;
+ }
p = fname + strlen(fname);
if (cvs_exclude) {
p = fname + strlen(fname);
if (cvs_exclude) {
if (strcmp(di->d_name,".")==0 ||
strcmp(di->d_name,"..")==0)
continue;
if (strcmp(di->d_name,".")==0 ||
strcmp(di->d_name,"..")==0)
continue;
- strncpy(p,di->d_name,MAXPATHLEN-l);
+ strncpy(p,di->d_name,MAXPATHLEN-(l+1));
send_file_name(f,flist,fname);
}
send_file_name(f,flist,fname);
}
extern int am_server;
extern int dry_run;
extern int am_server;
extern int dry_run;
#if SUPPORT_HARD_LINKS
static int hlink_compare(struct file_struct *f1,struct file_struct *f2)
#if SUPPORT_HARD_LINKS
static int hlink_compare(struct file_struct *f1,struct file_struct *f2)
if (lstat(hlink_list[i-1].name,&st1) != 0) continue;
if (lstat(hlink_list[i].name,&st2) != 0) {
if (!dry_run && link(hlink_list[i-1].name,hlink_list[i].name) != 0) {
if (lstat(hlink_list[i-1].name,&st1) != 0) continue;
if (lstat(hlink_list[i].name,&st2) != 0) {
if (!dry_run && link(hlink_list[i-1].name,hlink_list[i].name) != 0) {
- fprintf(FINFO,"link %s => %s : %s\n",
- hlink_list[i].name,hlink_list[i-1].name,strerror(errno));
+ if (verbose > 0)
+ fprintf(FINFO,"link %s => %s : %s\n",
+ hlink_list[i].name,
+ hlink_list[i-1].name,strerror(errno));
if (!dry_run && (unlink(hlink_list[i].name) != 0 ||
link(hlink_list[i-1].name,hlink_list[i].name) != 0)) {
if (!dry_run && (unlink(hlink_list[i].name) != 0 ||
link(hlink_list[i-1].name,hlink_list[i].name) != 0)) {
- fprintf(FINFO,"link %s => %s : %s\n",
- hlink_list[i].name,hlink_list[i-1].name,strerror(errno));
+ if (verbose > 0)
+ fprintf(FINFO,"link %s => %s : %s\n",
+ hlink_list[i].name,
+ hlink_list[i-1].name,strerror(errno));
- fprintf(FINFO,"%s => %s\n",
- hlink_list[i].name,hlink_list[i-1].name);
+ if (verbose > 0)
+ fprintf(FINFO,"%s => %s\n",
+ hlink_list[i].name,hlink_list[i-1].name);
if (ret == -1) {
read_check(buffer_f_in);
if (ret == -1) {
read_check(buffer_f_in);
fd_count = buffer_f_in+1;
}
fd_count = buffer_f_in+1;
}
tv.tv_sec = BLOCKING_TIMEOUT;
tv.tv_usec = 0;
count = select(fd_count,buffer_f_in == -1? NULL: &r_fds,
tv.tv_sec = BLOCKING_TIMEOUT;
tv.tv_usec = 0;
count = select(fd_count,buffer_f_in == -1? NULL: &r_fds,