[w3m-dev 03640] Re: cleanup (don't close connection of news server)

* anchor.c (_put_ahchor_news): always conv_str
		(_put_anchor_all): always conv_str
	* etc.c (close_all_fds): deleted
		(close_all_fds_except): added, except fd=f is left open
	* file.c (guess_filename): added
		(UFhalfclose): added
		(convertLine): cleanup_line if not raw mode
			check uf
		(readHeader): always convertLine
		(loadGeneralFile): rewrite
		(loadGopherDir): return Str, args change to ParsedURL and code
				rewrite
		(saveBuffer): always conv_str
		(_doFileCopy): close_all_fds
		(doFileSave): close_all_fds_except
		(uncompress_stream): dup, close_all_fds_except
	* form.c (form_fputs_decode): always conv_str
		(input_textarea): convertLine
	* frame.c (createFrameFile): convertLine
	* ftp.c (loadFTPDir): arg code
				rewrite
		(readFTPDir): convertLine
	* html.h (UFfileno): added
	* image.c (loadImage): close_all_fds
	* indep.h (RAW_MODE): added
	* local.c (loadLocalDir): return Str
		(dirBuffer): rewrite
		(localcgi_popen_r): close_all_fds
	* main.c (main): check SCM_LOCAL
			print err_msg
	* news.c (news_command): args cmd and arg
		(news_quit): news_command
		(openNewsStream): news_command
		(readNewsgroup): deleted
		(loadNewsgroup): added
		(closeNews): added
	* proto.h (loadGopherDir): update
		(conv_str): define for no JP_CHARSET
		(readFTPDir): deleted
		(loadFTPDir): added
		(readNewsgroup): deleted
		(loadNewsgroup): added
		(dirBuffer): deleted
		(loadLocalDir): added
		(close_all_fds): defined by close_all_fds_except
		(close_all_fds_except): added
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2003-01-15 16:11:43 +00:00
parent 04d2ffae3e
commit dfd33cccd5
14 changed files with 316 additions and 275 deletions

23
frame.c
View File

@@ -1,4 +1,4 @@
/* $Id: frame.c,v 1.28 2003/01/09 15:30:43 ukai Exp $ */
/* $Id: frame.c,v 1.29 2003/01/15 16:11:43 ukai Exp $ */
#include "fm.h"
#include "parsetagx.h"
#include "myctype.h"
@@ -410,8 +410,9 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level,
{
int r, c, t_stack;
URLFile f2;
char code;
#ifdef JP_CHARSET
char code, ic, charset[2];
char charset[2];
#endif /* JP_CHARSET */
char *d_target, *p_target, *s_target, *t_target;
ParsedURL *currentURL, base;
@@ -530,20 +531,15 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level,
t_target = "_blank";
d_target = TargetSelf ? s_target : t_target;
#ifdef JP_CHARSET
code = '\0';
#endif /* JP_CHARSET */
code = DocumentCode;
#endif
t_stack = 0;
if (frame.body->type &&
!strcasecmp(frame.body->type, "text/plain")) {
Str tmp;
fprintf(f1, "<pre>\n");
while ((tmp = StrmyUFgets(&f2))->length) {
#ifdef JP_CHARSET
if ((ic = checkShiftCode(tmp, code)) != '\0')
tmp = conv_str(tmp, (code = ic), InnerCode);
#endif /* JP_CHARSET */
cleanup_line(tmp, HTML_MODE);
tmp = convertLine(NULL, tmp, &code, HTML_MODE);
fprintf(f1, "%s", html_quote(tmp->ptr));
}
fprintf(f1, "</pre>\n");
@@ -560,12 +556,7 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level,
Str tmp = StrmyUFgets(&f2);
if (tmp->length == 0)
break;
#ifdef JP_CHARSET
if ((ic = checkShiftCode(tmp, code)) != '\0')
tmp = conv_str(tmp, (code = ic), InnerCode);
#endif /* JP_CHARSET */
cleanup_line(tmp, HTML_MODE);
tmp = convertLine(NULL, tmp, &code, HTML_MODE);
p = tmp->ptr;
}
read_token(tok, &p, &status, 1, status != R_ST_NORMAL);