don't show basedir in printed path (a aesthetic change only)
[rsync/rsync.git] / rsync.c
diff --git a/rsync.c b/rsync.c
index 1be378f..16f80ed 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -223,7 +223,7 @@ static int set_perms(char *fname,struct file_struct *file,struct stat *st,
   if (preserve_perms && !S_ISLNK(st->st_mode) &&
       st->st_mode != file->mode) {
     updated = 1;
-    if (chmod(fname,file->mode) != 0) {
+    if (do_chmod(fname,file->mode) != 0) {
       fprintf(FERROR,"failed to set permissions on %s : %s\n",
              fname,strerror(errno));
       return 0;
@@ -234,7 +234,7 @@ static int set_perms(char *fname,struct file_struct *file,struct stat *st,
   if ((am_root && preserve_uid && st->st_uid != file->uid) || 
       (preserve_gid && st->st_gid != file->gid)) {
     updated = 1;
-    if (lchown(fname,
+    if (do_lchown(fname,
               (am_root&&preserve_uid)?file->uid:-1,
               preserve_gid?file->gid:-1) != 0) {
       if (verbose>1 || preserve_uid)
@@ -879,6 +879,7 @@ off_t send_files(struct file_list *flist,int f_out,int f_in)
   int i;
   struct file_struct *file;
   int phase = 0;
+  int offset=0;
 
   if (verbose > 2)
     fprintf(FERROR,"send_files starting\n");
@@ -912,6 +913,7 @@ off_t send_files(struct file_list *flist,int f_out,int f_in)
                          return -1;
                  }
                  strcat(fname,"/");
+                 offset = strlen(file->basedir)+1;
          }
          strncat(fname,f_name(file),MAXPATHLEN-strlen(fname));
          
@@ -967,7 +969,7 @@ off_t send_files(struct file_list *flist,int f_out,int f_in)
                  fprintf(FERROR,"calling match_sums %s\n",fname);
          
          if (!am_server && verbose)
-                 printf("%s\n",fname);
+                 printf("%s\n",fname+offset);
          
          match_sums(f_out,s,buf,st.st_size);
          write_flush(f_out);