version 1.113, 2003/11/23 23:21:21 |
version 1.114, 2004/04/01 12:19:57 |
|
|
*cp++ = ch; |
*cp++ = ch; |
} while (cp < &buf[sizeof(buf) - 1] && ch != '\n'); |
} while (cp < &buf[sizeof(buf) - 1] && ch != '\n'); |
*cp = 0; |
*cp = 0; |
|
if (verbose_mode) |
|
fprintf(stderr, "Sink: %s", buf); |
|
|
if (buf[0] == '\01' || buf[0] == '\02') { |
if (buf[0] == '\01' || buf[0] == '\02') { |
if (iamremote == 0) |
if (iamremote == 0) |
|
|
size = size * 10 + (*cp++ - '0'); |
size = size * 10 + (*cp++ - '0'); |
if (*cp++ != ' ') |
if (*cp++ != ' ') |
SCREWUP("size not delimited"); |
SCREWUP("size not delimited"); |
|
if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) { |
|
run_err("error: unexpected filename: %s", cp); |
|
exit(1); |
|
} |
if (targisdir) { |
if (targisdir) { |
static char *namebuf; |
static char *namebuf; |
static int cursize; |
static int cursize; |
|
|
exists = stat(np, &stb) == 0; |
exists = stat(np, &stb) == 0; |
if (buf[0] == 'D') { |
if (buf[0] == 'D') { |
int mod_flag = pflag; |
int mod_flag = pflag; |
|
if (!iamrecursive) |
|
SCREWUP("received directory without -r"); |
if (exists) { |
if (exists) { |
if (!S_ISDIR(stb.st_mode)) { |
if (!S_ISDIR(stb.st_mode)) { |
errno = ENOTDIR; |
errno = ENOTDIR; |