X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/182dca5c80c40c5abe429a6c5307be25cc4b4d90..e260d7fb48763ca7e4bd19e1c97d993771ffcb53:/flist.c diff --git a/flist.c b/flist.c index 4c8d59f7..dd348c92 100644 --- a/flist.c +++ b/flist.c @@ -110,7 +110,10 @@ static void send_file_entry(struct file_struct *file,int f) } write_byte(f,flags); - write_byte(f,strlen(p)); + if (flags & SAME_DIR) + write_byte(f,strlen(p)); + else + write_int(f,strlen(p)); write_buf(f,p,strlen(p)); write_int(f,(int)file->modtime); write_int(f,(int)file->length); @@ -161,11 +164,13 @@ static void receive_file_entry(struct file_struct *file, char *p=NULL; int l1,l2; - l1 = read_byte(f); - if (flags & SAME_DIR) + if (flags & SAME_DIR) { + l1 = read_byte(f); l2 = strlen(lastdir); - else + } else { + l1 = read_int(f); l2 = 0; + } file->name = (char *)malloc(l1+l2+1); if (!file->name) out_of_memory("receive_file_entry");