extern int preserve_uid;
extern int preserve_gid;
extern int preserve_times;
+extern int relative_paths;
static char **local_exclude_list = NULL;
if (!file) return;
if (flist->count >= flist->malloced) {
- flist->malloced += 100;
- flist->files = (struct file_struct *)realloc(flist->files,
- sizeof(flist->files[0])*
- flist->malloced);
- if (!flist->files)
- out_of_memory("send_file_name");
+ if (flist->malloced < 100)
+ flist->malloced += 100;
+ else
+ flist->malloced *= 1.8;
+ flist->files = (struct file_struct *)realloc(flist->files,
+ sizeof(flist->files[0])*
+ flist->malloced);
+ if (!flist->files)
+ out_of_memory("send_file_name");
}
- if (strcmp(file->name,".") && strcmp(file->name,"/")) {
+ if (strcmp(file->name,"/")) {
flist->files[flist->count++] = *file;
send_file_entry(file,f);
}
}
dir = NULL;
- p = strrchr(fname,'/');
- if (p) {
- *p = 0;
- dir = fname;
- fname = p+1;
+
+ if (!relative_paths) {
+ p = strrchr(fname,'/');
+ if (p) {
+ *p = 0;
+ if (p == fname)
+ dir = "/";
+ else
+ dir = fname;
+ fname = p+1;
+ }
}
+
if (!*fname)
fname = ".";
int i = flist->count;
if (i >= flist->malloced) {
- flist->malloced += 100;
- flist->files =(struct file_struct *)realloc(flist->files,
- sizeof(flist->files[0])*
- flist->malloced);
- if (!flist->files)
- goto oom;
+ if (flist->malloced < 100)
+ flist->malloced += 100;
+ else
+ flist->malloced *= 1.8;
+ flist->files =(struct file_struct *)realloc(flist->files,
+ sizeof(flist->files[0])*
+ flist->malloced);
+ if (!flist->files)
+ goto oom;
}
receive_file_entry(&flist->files[i],flags,f);