diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-11 20:05:58 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-11 20:05:58 +0000 |
commit | b9cf2cda0de67eaf433ea67ed666a1c5447df0a3 (patch) | |
tree | a1b401ac126f011a6d2d8fdf5b58fe426c70d466 /file.c | |
parent | run make indent (diff) | |
download | w3m-b9cf2cda0de67eaf433ea67ed666a1c5447df0a3.tar.gz w3m-b9cf2cda0de67eaf433ea67ed666a1c5447df0a3.zip |
[w3m-dev 02822] Print FTP directory list for -dump_extra option
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.39 2001/12/27 18:01:52 ukai Exp $ */ +/* $Id: file.c,v 1.40 2002/01/11 20:05:58 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -1018,23 +1018,35 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer, /* openURL failure: it means either (1) the requested URL is a directory name * on an FTP server, or (2) is a local directory name. */ - extern Str FTPDIRtmp; if (fmInitialized && prevtrap) { term_raw(); signal(SIGINT, prevtrap); } switch (f.scheme) { case SCM_FTPDIR: - if (FTPDIRtmp->length > 0) { - b = loadHTMLString(FTPDIRtmp); + { + Str ftpdir = readFTPDir(&pu); + if (ftpdir && ftpdir->length > 0) { + FILE *src; + tmp = tmpfname(TMPF_SRC, ".html"); + pushText(fileToDelete, tmp->ptr); + src = fopen(tmp->ptr, "w"); + if (src) { + Strfputs(ftpdir, src); + fclose(src); + } + b = loadHTMLString(ftpdir); if (b) { if (b->currentURL.host == NULL && b->currentURL.file == NULL) copyParsedURL(&b->currentURL, &pu); b->real_scheme = pu.scheme; + if (src) + b->sourcefile = tmp->ptr; } return b; } + } break; case SCM_LOCAL: { |