aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-11 20:05:58 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-11 20:05:58 +0000
commitb9cf2cda0de67eaf433ea67ed666a1c5447df0a3 (patch)
treea1b401ac126f011a6d2d8fdf5b58fe426c70d466 /file.c
parentrun make indent (diff)
downloadw3m-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 '')
-rw-r--r--file.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/file.c b/file.c
index 9710d14..615b412 100644
--- a/file.c
+++ b/file.c
@@ -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:
{