mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-30 03:26:23 -04:00
ELinks doesn't change current directory, so get_cwd and set_cwd are useless
This commit is contained in:
parent
49ce097505
commit
f53cbc756f
@ -594,7 +594,6 @@ create_download_file_do(struct terminal *term, unsigned char *file, void *data,
|
|||||||
int resume)
|
int resume)
|
||||||
{
|
{
|
||||||
struct cdf_hop *cdf_hop = data;
|
struct cdf_hop *cdf_hop = data;
|
||||||
unsigned char *wd;
|
|
||||||
int h = -1;
|
int h = -1;
|
||||||
int saved_errno;
|
int saved_errno;
|
||||||
#ifdef NO_FILE_SECURITY
|
#ifdef NO_FILE_SECURITY
|
||||||
@ -605,9 +604,6 @@ create_download_file_do(struct terminal *term, unsigned char *file, void *data,
|
|||||||
|
|
||||||
if (!file) goto finish;
|
if (!file) goto finish;
|
||||||
|
|
||||||
wd = get_cwd();
|
|
||||||
set_cwd(term->cwd);
|
|
||||||
|
|
||||||
/* Create parent directories if needed. */
|
/* Create parent directories if needed. */
|
||||||
mkalldirs(file);
|
mkalldirs(file);
|
||||||
|
|
||||||
@ -619,11 +615,6 @@ create_download_file_do(struct terminal *term, unsigned char *file, void *data,
|
|||||||
sf ? 0600 : 0666);
|
sf ? 0600 : 0666);
|
||||||
saved_errno = errno; /* Saved in case of ... --Zas */
|
saved_errno = errno; /* Saved in case of ... --Zas */
|
||||||
|
|
||||||
if (wd) {
|
|
||||||
set_cwd(wd);
|
|
||||||
mem_free(wd);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (h == -1) {
|
if (h == -1) {
|
||||||
info_box(term, MSGBOX_FREE_TEXT,
|
info_box(term, MSGBOX_FREE_TEXT,
|
||||||
N_("Download error"), ALIGN_CENTER,
|
N_("Download error"), ALIGN_CENTER,
|
||||||
@ -667,7 +658,6 @@ create_download_file(struct terminal *term, unsigned char *fi,
|
|||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct cdf_hop *cdf_hop = mem_calloc(1, sizeof(*cdf_hop));
|
struct cdf_hop *cdf_hop = mem_calloc(1, sizeof(*cdf_hop));
|
||||||
unsigned char *wd;
|
|
||||||
|
|
||||||
if (!cdf_hop) {
|
if (!cdf_hop) {
|
||||||
callback(term, -1, data, 0);
|
callback(term, -1, data, 0);
|
||||||
@ -679,17 +669,8 @@ create_download_file(struct terminal *term, unsigned char *fi,
|
|||||||
cdf_hop->callback = callback;
|
cdf_hop->callback = callback;
|
||||||
cdf_hop->data = data;
|
cdf_hop->data = data;
|
||||||
|
|
||||||
/* FIXME: The wd bussiness is probably useless here? --pasky */
|
|
||||||
wd = get_cwd();
|
|
||||||
set_cwd(term->cwd);
|
|
||||||
|
|
||||||
/* Also the tilde will be expanded here. */
|
/* Also the tilde will be expanded here. */
|
||||||
lookup_unique_name(term, fi, resume, create_download_file_do, cdf_hop);
|
lookup_unique_name(term, fi, resume, create_download_file_do, cdf_hop);
|
||||||
|
|
||||||
if (wd) {
|
|
||||||
set_cwd(wd);
|
|
||||||
mem_free(wd);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user