* file.c (loadGopherDir): convertLine RAW_MODE

* ftp.c (loadFTPDir): ditto
* fix indent
From: Fumitoshi UKAI  <ukai@debian.or.jp>
This commit is contained in:
Fumitoshi UKAI
2003-01-15 16:24:25 +00:00
parent 76cac85389
commit 0aeedf43a0
6 changed files with 41 additions and 35 deletions
+6 -1
View File
@@ -1,3 +1,8 @@
2003-01-16 Fumitoshi UKAI <ukai@debian.or.jp>
* file.c (loadGopherDir): convertLine RAW_MODE
* ftp.c (loadFTPDir): ditto
2003-01-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> 2003-01-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03642] Re: cleanup (don't close connection of news server) * [w3m-dev 03642] Re: cleanup (don't close connection of news server)
@@ -6471,4 +6476,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1 * release-0-2-1
* import w3m-0.2.1 * import w3m-0.2.1
$Id: ChangeLog,v 1.683 2003/01/15 16:17:11 ukai Exp $ $Id: ChangeLog,v 1.684 2003/01/15 16:24:25 ukai Exp $
+19 -17
View File
@@ -1,4 +1,4 @@
/* $Id: file.c,v 1.185 2003/01/15 16:11:43 ukai Exp $ */ /* $Id: file.c,v 1.186 2003/01/15 16:24:25 ukai Exp $ */
#include "fm.h" #include "fm.h"
#include <sys/types.h> #include <sys/types.h>
#include "myctype.h" #include "myctype.h"
@@ -1563,24 +1563,24 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
return b; return b;
} }
else { else {
page = loadLocalDir(pu.real_file); page = loadLocalDir(pu.real_file);
t = "local:directory"; t = "local:directory";
#ifdef JP_CHARSET #ifdef JP_CHARSET
code = SystemCode; code = SystemCode;
#endif #endif
} }
} }
} }
break; break;
case SCM_FTPDIR: case SCM_FTPDIR:
page = loadFTPDir(&pu, &code); page = loadFTPDir(&pu, &code);
t = "ftp:directory"; t = "ftp:directory";
break; break;
#ifdef USE_NNTP #ifdef USE_NNTP
case SCM_NEWS_GROUP: case SCM_NEWS_GROUP:
page = loadNewsgroup(&pu, &code); page = loadNewsgroup(&pu, &code);
t = "news:group"; t = "news:group";
break; break;
#endif #endif
case SCM_UNKNOWN: case SCM_UNKNOWN:
#ifdef USE_EXTERNAL_URI_LOADER #ifdef USE_EXTERNAL_URI_LOADER
@@ -1896,15 +1896,15 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
if (do_download) { if (do_download) {
char *file; char *file;
if (!src) if (!src)
return NULL; return NULL;
file = guess_filename(pu.file); file = guess_filename(pu.file);
#ifdef USE_GOPHER #ifdef USE_GOPHER
if (f.scheme == SCM_GOPHER) if (f.scheme == SCM_GOPHER)
file = Sprintf("%s.html", file)->ptr; file = Sprintf("%s.html", file)->ptr;
#endif #endif
#ifdef USE_NNTP #ifdef USE_NNTP
if (f.scheme == SCM_NEWS_GROUP) if (f.scheme == SCM_NEWS_GROUP)
file = Sprintf("%s.html", file)->ptr; file = Sprintf("%s.html", file)->ptr;
#endif #endif
doFileMove(tmp->ptr, file); doFileMove(tmp->ptr, file);
return NO_BUFFER; return NO_BUFFER;
@@ -6610,7 +6610,9 @@ loadGopherDir(URLFile *uf, ParsedURL *pu, char *code)
tmp = parsedURL2Str(pu); tmp = parsedURL2Str(pu);
p = html_quote(tmp->ptr); p = html_quote(tmp->ptr);
tmp = convertLine(NULL, Strnew_charp(file_unquote(tmp->ptr)), code, NULL); tmp =
convertLine(NULL, Strnew_charp(file_unquote(tmp->ptr)), code,
RAW_MODE);
q = html_quote(tmp->ptr); q = html_quote(tmp->ptr);
tmp = Strnew_m_charp("<html>\n<head>\n<base href=\"", p, "\">\n<title>", q, tmp = Strnew_m_charp("<html>\n<head>\n<base href=\"", p, "\">\n<title>", q,
"</title>\n</head>\n<body>\n<h1>Index of ", q, "</title>\n</head>\n<body>\n<h1>Index of ", q,
@@ -7488,7 +7490,7 @@ _doFileCopy(char *tmpf, char *defstr, int download)
signal(SIGINT, SIG_IGN); signal(SIGINT, SIG_IGN);
SETPGRP(); SETPGRP();
close_tty(); close_tty();
close_all_fds(2); close_all_fds(2);
QuietMessage = TRUE; QuietMessage = TRUE;
fmInitialized = FALSE; fmInitialized = FALSE;
if (!_MoveFile(tmpf, p) && PreserveTimestamp && !is_pipe && if (!_MoveFile(tmpf, p) && PreserveTimestamp && !is_pipe &&
@@ -7595,7 +7597,7 @@ doFileSave(URLFile uf, char *defstr)
signal(SIGINT, SIG_IGN); signal(SIGINT, SIG_IGN);
SETPGRP(); SETPGRP();
close_tty(); close_tty();
close_all_fds_except(2, UFfileno(&uf)); close_all_fds_except(2, UFfileno(&uf));
QuietMessage = TRUE; QuietMessage = TRUE;
fmInitialized = FALSE; fmInitialized = FALSE;
if (!save2tmp(uf, p) && PreserveTimestamp && uf.modtime != -1) if (!save2tmp(uf, p) && PreserveTimestamp && uf.modtime != -1)
+6 -4
View File
@@ -1,4 +1,4 @@
/* $Id: ftp.c,v 1.25 2003/01/15 16:14:41 ukai Exp $ */ /* $Id: ftp.c,v 1.26 2003/01/15 16:24:25 ukai Exp $ */
#include <stdio.h> #include <stdio.h>
#include <pwd.h> #include <pwd.h>
#include <Str.h> #include <Str.h>
@@ -456,7 +456,9 @@ loadFTPDir(ParsedURL *pu, char *code)
if (Strlastchar(tmp) != '/') if (Strlastchar(tmp) != '/')
Strcat_char(tmp, '/'); Strcat_char(tmp, '/');
fn = html_quote(tmp->ptr); fn = html_quote(tmp->ptr);
tmp = convertLine(NULL, Strnew_charp(file_unquote(tmp->ptr)), code, NULL); tmp =
convertLine(NULL, Strnew_charp(file_unquote(tmp->ptr)), code,
RAW_MODE);
q = html_quote(tmp->ptr); q = html_quote(tmp->ptr);
FTPDIRtmp = Strnew_m_charp("<html>\n<head>\n<base href=\"", fn, FTPDIRtmp = Strnew_m_charp("<html>\n<head>\n<base href=\"", fn,
"\">\n<title>", q, "\">\n<title>", q,
@@ -525,7 +527,7 @@ loadFTPDir(ParsedURL *pu, char *code)
} }
date++; date++;
len = strlen(fn); len = strlen(fn);
tmp = convertLine(NULL, Strnew_charp(fn), code, NULL); tmp = convertLine(NULL, Strnew_charp(fn), code, RAW_MODE);
Strcat_m_charp(FTPDIRtmp, "<a href=\"", html_quote(file_quote(fn)), Strcat_m_charp(FTPDIRtmp, "<a href=\"", html_quote(file_quote(fn)),
"\">", html_quote(tmp->ptr), NULL); "\">", html_quote(tmp->ptr), NULL);
if (ftype == FTPDIR_LINK) { if (ftype == FTPDIR_LINK) {
@@ -557,7 +559,7 @@ loadFTPDir(ParsedURL *pu, char *code)
qsort(flist, nfile, sizeof(char *), strCmp); qsort(flist, nfile, sizeof(char *), strCmp);
for (i = 0; i < nfile; i++) { for (i = 0; i < nfile; i++) {
fn = flist[i]; fn = flist[i];
tmp = convertLine(NULL, Strnew_charp(fn), code, NULL); tmp = convertLine(NULL, Strnew_charp(fn), code, RAW_MODE);
Strcat_m_charp(FTPDIRtmp, "<li><a href=\"", Strcat_m_charp(FTPDIRtmp, "<li><a href=\"",
html_quote(file_quote(fn)), "\">", html_quote(file_quote(fn)), "\">",
html_quote(tmp->ptr), "</a>\n", NULL); html_quote(tmp->ptr), "</a>\n", NULL);
+2 -2
View File
@@ -1,4 +1,4 @@
/* $Id: local.c,v 1.19 2003/01/15 16:17:11 ukai Exp $ */ /* $Id: local.c,v 1.20 2003/01/15 16:24:25 ukai Exp $ */
#include "fm.h" #include "fm.h"
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
@@ -63,7 +63,7 @@ loadLocalDir(char *dname)
qdir = html_quote(Str_conv_from_system(dirname)->ptr); qdir = html_quote(Str_conv_from_system(dirname)->ptr);
tmp = Strnew_m_charp("<HTML>\n<HEAD>\n<BASE HREF=\"file://", qdir, tmp = Strnew_m_charp("<HTML>\n<HEAD>\n<BASE HREF=\"file://", qdir,
"\">\n<TITLE>Directory list of ", qdir, "\">\n<TITLE>Directory list of ", qdir,
"</TITLE>\n</HEAD>\n<BODY>\n<H1>Directory list of ", "</TITLE>\n</HEAD>\n<BODY>\n<H1>Directory list of ",
qdir, "</H1>\n", NULL); qdir, "</H1>\n", NULL);
flist = New_N(char *, nfile_max); flist = New_N(char *, nfile_max);
nfile = 0; nfile = 0;
+2 -2
View File
@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.192 2003/01/15 16:11:43 ukai Exp $ */ /* $Id: main.c,v 1.193 2003/01/15 16:24:25 ukai Exp $ */
#define MAINPROGRAM #define MAINPROGRAM
#include "fm.h" #include "fm.h"
#include <signal.h> #include <signal.h>
@@ -4414,7 +4414,7 @@ vwSrc(void)
} }
else if (Currentbuf->real_scheme == SCM_LOCAL && else if (Currentbuf->real_scheme == SCM_LOCAL &&
!(Currentbuf->real_type && !(Currentbuf->real_type &&
!strcasecmp(Currentbuf->real_type, "local:directory"))) { !strcasecmp(Currentbuf->real_type, "local:directory"))) {
fn = Currentbuf->filename; fn = Currentbuf->filename;
} }
else { else {
+6 -9
View File
@@ -1,4 +1,4 @@
/* $Id: news.c,v 1.13 2003/01/15 16:14:41 ukai Exp $ */ /* $Id: news.c,v 1.14 2003/01/15 16:24:25 ukai Exp $ */
#include "fm.h" #include "fm.h"
#include "myctype.h" #include "myctype.h"
#include <stdio.h> #include <stdio.h>
@@ -343,16 +343,14 @@ loadNewsgroup(ParsedURL *pu, char *code)
if (SETJMP(AbortLoading) != 0) { if (SETJMP(AbortLoading) != 0) {
news_close(&current_news); news_close(&current_news);
Strcat_charp(page, Strcat_charp(page, "</table>\n<p>Transfer Interrupted!\n");
"</table>\n<p>Transfer Interrupted!\n");
goto news_end; goto news_end;
} }
trap = signal(SIGINT, KeyAbort); trap = signal(SIGINT, KeyAbort);
if (fmInitialized) if (fmInitialized)
term_cbreak(); term_cbreak();
tmp = tmp = news_command(&current_news, "GROUP", group, &status);
news_command(&current_news, "GROUP", group, &status);
if (status != 211) if (status != 211)
goto news_list; goto news_list;
if (sscanf(tmp->ptr, "%d %d %d %d", &status, &i, &first, &last) != 4) if (sscanf(tmp->ptr, "%d %d %d %d", &status, &i, &first, &last) != 4)
@@ -378,9 +376,7 @@ loadNewsgroup(ParsedURL *pu, char *code)
} }
page = Sprintf("<html>\n<head>\n<base href=\"%s\">\n\ page = Sprintf("<html>\n<head>\n<base href=\"%s\">\n\
<title>Newsgroup: %s %d-%d</title>\n\ <title>Newsgroup: %s %d-%d</title>\n\
</head>\n<body>\n<h1>Newsgroup: %s %d-%d</h1>\n<hr>\n", </head>\n<body>\n<h1>Newsgroup: %s %d-%d</h1>\n<hr>\n", parsedURL2Str(pu)->ptr, qgroup, start, end, qgroup, start, end);
parsedURL2Str(pu)->ptr, qgroup, start, end, qgroup, start,
end);
if (start > first) { if (start > first) {
i = start - MaxNewsMessage; i = start - MaxNewsMessage;
if (i < first) if (i < first)
@@ -427,7 +423,8 @@ loadNewsgroup(ParsedURL *pu, char *code)
init_stream(&f, SCM_NEWS, current_news.rf); init_stream(&f, SCM_NEWS, current_news.rf);
buf = newBuffer(INIT_BUFFER_WIDTH); buf = newBuffer(INIT_BUFFER_WIDTH);
for (i = start; i <= end && i <= last; i++) { for (i = start; i <= end && i <= last; i++) {
news_command(&current_news, "HEAD", Sprintf("%d", i)->ptr, &status); news_command(&current_news, "HEAD", Sprintf("%d", i)->ptr,
&status);
if (status != 221) if (status != 221)
continue; continue;
readHeader(&f, buf, FALSE, NULL); readHeader(&f, buf, FALSE, NULL);