}
}
+ if (len < 0) {
+ rprintf(FERROR, "read %s: %s\n",
+ full_fname(source), strerror(errno));
+ close(ifd);
+ close(ofd);
+ return -1;
+ }
+
if (close(ifd) < 0) {
rprintf(FINFO, "close failed on %s: %s\n",
full_fname(source), strerror(errno));
return -1;
}
- if (len < 0) {
- rprintf(FERROR,"read %s: %s\n",
- full_fname(source), strerror(errno));
- return -1;
- }
-
return 0;
}
static void glob_expand_one(char *s, char **argv, int *argc, int maxargs)
{
#if !(defined(HAVE_GLOB) && defined(HAVE_GLOB_H))
- if (!*s) s = ".";
+ if (maxargs <= *argc)
+ return;
+ if (!*s)
+ s = ".";
s = argv[*argc] = strdup(s);
exclude_server_path(s);
(*argc)++;
glob_t globbuf;
int i;
- if (!*s) s = ".";
+ if (!*s)
+ s = ".";
s = argv[*argc] = strdup(s);
- if (sanitize_paths) {
+ if (sanitize_paths)
sanitize_path(s, NULL);
- }
memset(&globbuf, 0, sizeof globbuf);
if (!exclude_server_path(s))