version 1.11, 2001/02/07 00:10:18 |
version 1.12, 2001/02/07 13:12:29 |
|
|
|
|
/* XXX: finish implementation of all commands */ |
/* XXX: finish implementation of all commands */ |
/* XXX: do fnmatch() instead of using raw pathname */ |
/* XXX: do fnmatch() instead of using raw pathname */ |
|
/* XXX: globbed ls */ |
/* XXX: recursive operations */ |
/* XXX: recursive operations */ |
|
|
#include "includes.h" |
#include "includes.h" |
|
|
*pwd = tmp; |
*pwd = tmp; |
break; |
break; |
case I_LS: |
case I_LS: |
|
if (!path1) { |
|
do_ls(in, out, *pwd); |
|
break; |
|
} |
path1 = make_absolute(path1, *pwd); |
path1 = make_absolute(path1, *pwd); |
do_ls(in, out, path1?path1:*pwd); |
if ((tmp = do_realpath(in, out, path1)) == NULL) |
|
break; |
|
xfree(path1); |
|
path1 = tmp; |
|
if ((aa = do_stat(in, out, path1)) == NULL) |
|
break; |
|
if ((aa->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && |
|
!S_ISDIR(aa->perm)) { |
|
error("Can't ls: \"%s\" is not a directory", path1); |
|
break; |
|
} |
|
do_ls(in, out, path1); |
break; |
break; |
case I_LCHDIR: |
case I_LCHDIR: |
if (chdir(path1) == -1) |
if (chdir(path1) == -1) |