|
Lines 422-438
is_dir(char *path)
Link Here
|
| 422 |
} |
422 |
} |
| 423 |
|
423 |
|
| 424 |
static int |
424 |
static int |
| 425 |
is_reg(char *path) |
|
|
| 426 |
{ |
| 427 |
struct stat sb; |
| 428 |
|
| 429 |
if (stat(path, &sb) == -1) |
| 430 |
fatal("stat %s: %s", path, strerror(errno)); |
| 431 |
|
| 432 |
return(S_ISREG(sb.st_mode)); |
| 433 |
} |
| 434 |
|
| 435 |
static int |
| 436 |
remote_is_dir(struct sftp_conn *conn, char *path) |
425 |
remote_is_dir(struct sftp_conn *conn, char *path) |
| 437 |
{ |
426 |
{ |
| 438 |
Attrib *a; |
427 |
Attrib *a; |
|
Lines 520-525
process_put(struct sftp_conn *conn, char
Link Here
|
| 520 |
glob_t g; |
509 |
glob_t g; |
| 521 |
int err = 0; |
510 |
int err = 0; |
| 522 |
int i; |
511 |
int i; |
|
|
512 |
struct stat sb; |
| 523 |
|
513 |
|
| 524 |
if (dst) { |
514 |
if (dst) { |
| 525 |
tmp_dst = xstrdup(dst); |
515 |
tmp_dst = xstrdup(dst); |
|
Lines 528-534
process_put(struct sftp_conn *conn, char
Link Here
|
| 528 |
|
518 |
|
| 529 |
memset(&g, 0, sizeof(g)); |
519 |
memset(&g, 0, sizeof(g)); |
| 530 |
debug3("Looking up %s", src); |
520 |
debug3("Looking up %s", src); |
| 531 |
if (glob(src, 0, NULL, &g)) { |
521 |
if (glob(src, GLOB_NOCHECK, NULL, &g)) { |
| 532 |
error("File \"%s\" not found.", src); |
522 |
error("File \"%s\" not found.", src); |
| 533 |
err = -1; |
523 |
err = -1; |
| 534 |
goto out; |
524 |
goto out; |
|
Lines 543-549
process_put(struct sftp_conn *conn, char
Link Here
|
| 543 |
} |
533 |
} |
| 544 |
|
534 |
|
| 545 |
for (i = 0; g.gl_pathv[i] && !interrupted; i++) { |
535 |
for (i = 0; g.gl_pathv[i] && !interrupted; i++) { |
| 546 |
if (!is_reg(g.gl_pathv[i])) { |
536 |
if (stat(g.gl_pathv[i], &sb) == -1) { |
|
|
537 |
error("stat %s: %s", g.gl_pathv[i], strerror(errno)); |
| 538 |
continue; |
| 539 |
} |
| 540 |
|
| 541 |
if (!S_ISREG(sb.st_mode)) { |
| 547 |
error("skipping non-regular file %s", |
542 |
error("skipping non-regular file %s", |
| 548 |
g.gl_pathv[i]); |
543 |
g.gl_pathv[i]); |
| 549 |
continue; |
544 |
continue; |