version 1.64, 2003/11/08 19:17:29 |
version 1.65, 2003/11/21 11:57:03 |
|
|
} |
} |
if (cp[i] == '\\') { /* Escaped characters */ |
if (cp[i] == '\\') { /* Escaped characters */ |
i++; |
i++; |
if (cp[i] != '\'' && cp[i] != '\"' && |
if (cp[i] != '\'' && cp[i] != '\"' && |
cp[i] != '\\') { |
cp[i] != '\\') { |
error("Bad escaped character '\%c'", |
error("Bad escaped character '\%c'", |
cp[i]); |
cp[i]); |
|
|
return (0); |
return (0); |
|
|
fail: |
fail: |
xfree(*path); |
xfree(*path); |
*path = NULL; |
*path = NULL; |
return (-1); |
return (-1); |
} |
} |
|
|
|
|
|
|
for (i = 0; g.gl_pathv[i]; i++) { |
for (i = 0; g.gl_pathv[i]; i++) { |
if (!is_reg(g.gl_pathv[i])) { |
if (!is_reg(g.gl_pathv[i])) { |
error("skipping non-regular file %s", |
error("skipping non-regular file %s", |
g.gl_pathv[i]); |
g.gl_pathv[i]); |
continue; |
continue; |
} |
} |
|
|
for (n = 0; d[n] != NULL; n++) |
for (n = 0; d[n] != NULL; n++) |
m = MAX(m, strlen(d[n]->filename)); |
m = MAX(m, strlen(d[n]->filename)); |
|
|
if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1) |
if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1) |
width = ws.ws_col; |
width = ws.ws_col; |
|
|
columns = width / (m + 2); |
columns = width / (m + 2); |
|
|
strncmp(path, g.gl_pathv[0], strlen(g.gl_pathv[0]) - 1) == 0) { |
strncmp(path, g.gl_pathv[0], strlen(g.gl_pathv[0]) - 1) == 0) { |
if ((a = do_lstat(conn, path, 1)) == NULL) { |
if ((a = do_lstat(conn, path, 1)) == NULL) { |
globfree(&g); |
globfree(&g); |
return (-1); |
return (-1); |
} |
} |
if ((a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && |
if ((a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && |
S_ISDIR(a->perm)) { |
S_ISDIR(a->perm)) { |
|
|
|
|
if (!(lflag & SHORT_VIEW)) { |
if (!(lflag & SHORT_VIEW)) { |
int m = 0, width = 80; |
int m = 0, width = 80; |
struct winsize ws; |
struct winsize ws; |
|
|
/* Count entries for sort and find longest filename */ |
/* Count entries for sort and find longest filename */ |
for (i = 0; g.gl_pathv[i]; i++) |
for (i = 0; g.gl_pathv[i]; i++) |
m = MAX(m, strlen(g.gl_pathv[i])); |
m = MAX(m, strlen(g.gl_pathv[i])); |
|
|
if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1) |
if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1) |
|
|
*iflag = 1; |
*iflag = 1; |
cp++; |
cp++; |
} |
} |
|
|
/* Figure out which command we have */ |
/* Figure out which command we have */ |
for (i = 0; cmds[i].c; i++) { |
for (i = 0; cmds[i].c; i++) { |
int cmdlen = strlen(cmds[i].c); |
int cmdlen = strlen(cmds[i].c); |