1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

ELinks doesn't change current directory, so get_cwd and set_cwd are useless

This commit is contained in:
Witold Filipczyk 2006-07-09 00:25:30 +02:00 committed by Witold Filipczyk
parent 49ce097505
commit f53cbc756f

View File

@ -594,7 +594,6 @@ create_download_file_do(struct terminal *term, unsigned char *file, void *data,
int resume)
{
struct cdf_hop *cdf_hop = data;
unsigned char *wd;
int h = -1;
int saved_errno;
#ifdef NO_FILE_SECURITY
@ -605,9 +604,6 @@ create_download_file_do(struct terminal *term, unsigned char *file, void *data,
if (!file) goto finish;
wd = get_cwd();
set_cwd(term->cwd);
/* Create parent directories if needed. */
mkalldirs(file);
@ -619,11 +615,6 @@ create_download_file_do(struct terminal *term, unsigned char *file, void *data,
sf ? 0600 : 0666);
saved_errno = errno; /* Saved in case of ... --Zas */
if (wd) {
set_cwd(wd);
mem_free(wd);
}
if (h == -1) {
info_box(term, MSGBOX_FREE_TEXT,
N_("Download error"), ALIGN_CENTER,
@ -667,7 +658,6 @@ create_download_file(struct terminal *term, unsigned char *fi,
void *data)
{
struct cdf_hop *cdf_hop = mem_calloc(1, sizeof(*cdf_hop));
unsigned char *wd;
if (!cdf_hop) {
callback(term, -1, data, 0);
@ -679,17 +669,8 @@ create_download_file(struct terminal *term, unsigned char *fi,
cdf_hop->callback = callback;
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. */
lookup_unique_name(term, fi, resume, create_download_file_do, cdf_hop);
if (wd) {
set_cwd(wd);
mem_free(wd);
}
}