diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | sftp-int.c | 18 |
2 files changed, 13 insertions, 10 deletions
@@ -12,6 +12,9 @@ | |||
12 | [sftp-client.c sftp-client.h sftp-glob.c sftp-int.c] | 12 | [sftp-client.c sftp-client.h sftp-glob.c sftp-int.c] |
13 | Revise globbing for get/put to be more shell-like. In particular, | 13 | Revise globbing for get/put to be more shell-like. In particular, |
14 | "get/put file* directory/" now works. ok markus@ | 14 | "get/put file* directory/" now works. ok markus@ |
15 | - markus@cvs.openbsd.org 2001/03/16 09:55:53 | ||
16 | [sftp-int.c] | ||
17 | fix memset and whitespace | ||
15 | 18 | ||
16 | 20010315 | 19 | 20010315 |
17 | - OpenBSD CVS Sync | 20 | - OpenBSD CVS Sync |
@@ -4574,4 +4577,4 @@ | |||
4574 | - Wrote replacements for strlcpy and mkdtemp | 4577 | - Wrote replacements for strlcpy and mkdtemp |
4575 | - Released 1.0pre1 | 4578 | - Released 1.0pre1 |
4576 | 4579 | ||
4577 | $Id: ChangeLog,v 1.964 2001/03/17 00:34:46 mouring Exp $ | 4580 | $Id: ChangeLog,v 1.965 2001/03/17 00:36:17 mouring Exp $ |
diff --git a/sftp-int.c b/sftp-int.c index fdadf23b2..f77e2ebd9 100644 --- a/sftp-int.c +++ b/sftp-int.c | |||
@@ -26,7 +26,7 @@ | |||
26 | /* XXX: recursive operations */ | 26 | /* XXX: recursive operations */ |
27 | 27 | ||
28 | #include "includes.h" | 28 | #include "includes.h" |
29 | RCSID("$OpenBSD: sftp-int.c,v 1.29 2001/03/16 08:16:18 djm Exp $"); | 29 | RCSID("$OpenBSD: sftp-int.c,v 1.30 2001/03/16 09:55:53 markus Exp $"); |
30 | 30 | ||
31 | #include "buffer.h" | 31 | #include "buffer.h" |
32 | #include "xmalloc.h" | 32 | #include "xmalloc.h" |
@@ -281,7 +281,7 @@ get_pathname(const char **cpp, char **path) | |||
281 | /* Check for quoted filenames */ | 281 | /* Check for quoted filenames */ |
282 | if (*cp == '\"' || *cp == '\'') { | 282 | if (*cp == '\"' || *cp == '\'') { |
283 | quot = *cp++; | 283 | quot = *cp++; |
284 | 284 | ||
285 | end = strchr(cp, quot); | 285 | end = strchr(cp, quot); |
286 | if (end == NULL) { | 286 | if (end == NULL) { |
287 | error("Unterminated quote"); | 287 | error("Unterminated quote"); |
@@ -346,11 +346,11 @@ process_get(int in, int out, char *src, char *dst, char *pwd, int pflag) | |||
346 | glob_t g; | 346 | glob_t g; |
347 | int err = 0; | 347 | int err = 0; |
348 | int i; | 348 | int i; |
349 | 349 | ||
350 | abs_src = xstrdup(src); | 350 | abs_src = xstrdup(src); |
351 | abs_src = make_absolute(abs_src, pwd); | 351 | abs_src = make_absolute(abs_src, pwd); |
352 | 352 | ||
353 | memset(&g, '\0', sizeof(g)); | 353 | memset(&g, 0, sizeof(g)); |
354 | debug3("Looking up %s", abs_src); | 354 | debug3("Looking up %s", abs_src); |
355 | if (remote_glob(in, out, abs_src, 0, NULL, &g)) { | 355 | if (remote_glob(in, out, abs_src, 0, NULL, &g)) { |
356 | error("File \"%s\" not found.", abs_src); | 356 | error("File \"%s\" not found.", abs_src); |
@@ -382,12 +382,12 @@ process_get(int in, int out, char *src, char *dst, char *pwd, int pflag) | |||
382 | 382 | ||
383 | /* Multiple matches, dst may be directory or unspecified */ | 383 | /* Multiple matches, dst may be directory or unspecified */ |
384 | if (dst && !is_dir(dst)) { | 384 | if (dst && !is_dir(dst)) { |
385 | error("Multiple files match, but \"%s\" is not a directory", | 385 | error("Multiple files match, but \"%s\" is not a directory", |
386 | dst); | 386 | dst); |
387 | err = -1; | 387 | err = -1; |
388 | goto out; | 388 | goto out; |
389 | } | 389 | } |
390 | 390 | ||
391 | for(i = 0; g.gl_pathv[i]; i++) { | 391 | for(i = 0; g.gl_pathv[i]; i++) { |
392 | if (infer_path(g.gl_pathv[i], &tmp)) { | 392 | if (infer_path(g.gl_pathv[i], &tmp)) { |
393 | err = -1; | 393 | err = -1; |
@@ -429,7 +429,7 @@ process_put(int in, int out, char *src, char *dst, char *pwd, int pflag) | |||
429 | tmp_dst = make_absolute(tmp_dst, pwd); | 429 | tmp_dst = make_absolute(tmp_dst, pwd); |
430 | } | 430 | } |
431 | 431 | ||
432 | memset(&g, '\0', sizeof(g)); | 432 | memset(&g, 0, sizeof(g)); |
433 | debug3("Looking up %s", src); | 433 | debug3("Looking up %s", src); |
434 | if (glob(src, 0, NULL, &g)) { | 434 | if (glob(src, 0, NULL, &g)) { |
435 | error("File \"%s\" not found.", src); | 435 | error("File \"%s\" not found.", src); |
@@ -461,7 +461,7 @@ process_put(int in, int out, char *src, char *dst, char *pwd, int pflag) | |||
461 | 461 | ||
462 | /* Multiple matches, dst may be directory or unspecified */ | 462 | /* Multiple matches, dst may be directory or unspecified */ |
463 | if (tmp_dst && !remote_is_dir(in, out, tmp_dst)) { | 463 | if (tmp_dst && !remote_is_dir(in, out, tmp_dst)) { |
464 | error("Multiple files match, but \"%s\" is not a directory", | 464 | error("Multiple files match, but \"%s\" is not a directory", |
465 | tmp_dst); | 465 | tmp_dst); |
466 | err = -1; | 466 | err = -1; |
467 | goto out; | 467 | goto out; |
@@ -736,7 +736,7 @@ parse_dispatch_command(int in, int out, const char *cmd, char **pwd) | |||
736 | path1 = tmp; | 736 | path1 = tmp; |
737 | if ((aa = do_stat(in, out, path1, 0)) == NULL) | 737 | if ((aa = do_stat(in, out, path1, 0)) == NULL) |
738 | break; | 738 | break; |
739 | if ((aa->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && | 739 | if ((aa->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && |
740 | !S_ISDIR(aa->perm)) { | 740 | !S_ISDIR(aa->perm)) { |
741 | error("Can't ls: \"%s\" is not a directory", path1); | 741 | error("Can't ls: \"%s\" is not a directory", path1); |
742 | break; | 742 | break; |