version 1.18, 2011/10/23 00:49:25 |
version 1.19, 2011/10/23 08:34:01 |
|
|
{ |
{ |
struct args *args = self->args; |
struct args *args = self->args; |
struct client *c = ctx->cmdclient; |
struct client *c = ctx->cmdclient; |
|
struct session *s; |
FILE *f; |
FILE *f; |
const char *path; |
const char *path, *newpath, *wd; |
char *pdata, *new_pdata, *cause; |
char *pdata, *new_pdata, *cause; |
size_t psize; |
size_t psize; |
u_int limit; |
u_int limit; |
|
|
return (1); |
return (1); |
} |
} |
|
|
|
if (c != NULL) |
|
wd = c->cwd; |
|
else if ((s = cmd_current_session(ctx, 0)) != NULL) { |
|
wd = options_get_string(&s->options, "default-path"); |
|
if (*wd == '\0') |
|
wd = s->cwd; |
|
} else |
|
wd = NULL; |
|
if (wd != NULL && *wd != '\0') { |
|
newpath = get_full_path(wd, path); |
|
if (newpath != NULL) |
|
path = newpath; |
|
} |
if ((f = fopen(path, "rb")) == NULL) { |
if ((f = fopen(path, "rb")) == NULL) { |
ctx->error(ctx, "%s: %s", path, strerror(errno)); |
ctx->error(ctx, "%s: %s", path, strerror(errno)); |
return (-1); |
return (-1); |