version 1.8, 2011/09/16 15:36:18 |
version 1.8.2.2, 2013/01/16 05:25:59 |
|
|
/* $NetBSD$ */ |
/* $NetBSD$ */ |
/* $OpenBSD: sftp.c,v 1.132 2010/12/04 00:18:01 djm Exp $ */ |
/* $OpenBSD: sftp.c,v 1.136 2012/06/22 14:36:33 dtucker Exp $ */ |
/* |
/* |
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> |
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> |
* |
* |
|
|
do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, |
do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, |
int lflag) |
int lflag) |
{ |
{ |
Attrib *a = NULL; |
|
char *fname, *lname; |
char *fname, *lname; |
glob_t g; |
glob_t g; |
int err; |
int err; |
Line 781 do_globbed_ls(struct sftp_conn *conn, ch |
|
Line 780 do_globbed_ls(struct sftp_conn *conn, ch |
|
memset(&g, 0, sizeof(g)); |
memset(&g, 0, sizeof(g)); |
|
|
if (remote_glob(conn, path, |
if (remote_glob(conn, path, |
GLOB_MARK|GLOB_NOCHECK|GLOB_BRACE|GLOB_KEEPSTAT, NULL, &g) || |
GLOB_MARK|GLOB_NOCHECK|GLOB_BRACE|GLOB_KEEPSTAT|GLOB_NOSORT, |
|
NULL, &g) || |
(g.gl_pathc && !g.gl_matchc)) { |
(g.gl_pathc && !g.gl_matchc)) { |
if (g.gl_pathc) |
if (g.gl_pathc) |
globfree(&g); |
globfree(&g); |
Line 821 do_globbed_ls(struct sftp_conn *conn, ch |
|
Line 821 do_globbed_ls(struct sftp_conn *conn, ch |
|
colspace = width / columns; |
colspace = width / columns; |
} |
} |
|
|
for (i = 0; g.gl_pathv[i] && !interrupted; i++, a = NULL) { |
for (i = 0; g.gl_pathv[i] && !interrupted; i++) { |
fname = path_strip(g.gl_pathv[i], strip_path); |
fname = path_strip(g.gl_pathv[i], strip_path); |
if (lflag & LS_LONG_VIEW) { |
if (lflag & LS_LONG_VIEW) { |
#if GLOB_KEEPSTAT != 0 |
#if GLOB_KEEPSTAT != 0 |
Line 1633 complete_cmd_parse(EditLine *el, char *c |
|
Line 1633 complete_cmd_parse(EditLine *el, char *c |
|
} |
} |
list[count] = NULL; |
list[count] = NULL; |
|
|
if (count == 0) |
if (count == 0) { |
|
xfree(list); |
return 0; |
return 0; |
|
} |
|
|
/* Complete ambigious command */ |
/* Complete ambigious command */ |
tmp = complete_ambiguous(cmd, list, count); |
tmp = complete_ambiguous(cmd, list, count); |
Line 1931 interactive_loop(struct sftp_conn *conn, |
|
Line 1933 interactive_loop(struct sftp_conn *conn, |
|
xfree(dir); |
xfree(dir); |
} |
} |
|
|
setvbuf(stdout, NULL, _IOLBF, 0); |
setlinebuf(stdout); |
setvbuf(infile, NULL, _IOLBF, 0); |
setlinebuf(infile); |
|
|
interactive = !batchmode && isatty(STDIN_FILENO); |
interactive = !batchmode && isatty(STDIN_FILENO); |
err = 0; |
err = 0; |