diff options
| author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-02-04 16:26:27 +0000 | 
|---|---|---|
| committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-02-04 16:26:27 +0000 | 
| commit | 8fdd83b62ac34041dc3d73376a093197166bf640 (patch) | |
| tree | 4387ee67a5fc538163ed232dea19fbd1ab44b3d2 | |
| parent | [w3m-dev 02984] inline image improvements and cleanups (diff) | |
| download | w3m-branch-0-2-5.tar.gz w3m-branch-0-2-5.zip | |
w3m 0.2.5.1 - backport from w3m/0.2.5+cvs-1.299release-0-2-5-1branch-0-2-5
Diffstat (limited to '')
| -rw-r--r-- | ChangeLog | 307 | ||||
| -rw-r--r-- | NEWS | 11 | ||||
| -rw-r--r-- | doc-jp/README | 4 | ||||
| -rw-r--r-- | doc/README | 4 | ||||
| -rw-r--r-- | file.c | 728 | ||||
| -rw-r--r-- | mktable.c | 2 | ||||
| -rw-r--r-- | url.c | 2 | ||||
| -rw-r--r-- | version.c.in | 4 | 
8 files changed, 150 insertions, 912 deletions
| @@ -1,312 +1,25 @@ -2002-02-04  TSUCHIYA Masatoshi  <tsuchiya@pine.kuee.kyoto-u.ac.jp> +2002-02-05  Fumitoshi UKAI  <ukai@debian.or.jp> -	* [w3m-dev 02986] -	* file.c (print_internal_information): Don't print boundaries. -          Use henv->f instead of stdout. -	 -2002-02-04  Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> - -	* [w3m-dev 02984] inline image improvements and cleanups -	* config.h.dist (HAVE_SYMLINK) added -	* config.h.dist (HAVE_LSTAT): added -	* configure: symlink() check -	* configure: lstat() check -	* fm.h (maxLoadImage): added -	* form.c (form_write_from_file): s/HAVE_READLINK/HAVE_LSTAT/ -	* image.c: include <sys/stat.h> -	* image.c (MAX_LOAD_IMAGE): default 8 -	* image.c (max_load_image): deleted -	* image.c (n_load_image): added -	* image.c (showImageProgress): added -	* image.c (loadImage): check load image count -			s/HAVE_READLINK/HAVE_LSTAT/ (HAVE_SYMLINK) -			showImageProgress -	* local.c: include <sys/stat.h> -		s/HAVE_READLINK/HAVE_LSTAT/ -	* rc.c (CMT_MAX_LOAD_IMAGE): added -	* rc.c (max_load_image): added -	* doc/README.img: update -	* doc-jp/README.img: update -	 -	* file.c (process_img): pre_int fix - -2002-02-04  Fumitoshi UKAI  <ukai@debian.or.jp> +	* w3m 0.2.5.1 - backport from w3m/0.2.5+cvs-1.299 +	* version.c.in: update +	* doc/README: version 0.2.5.1, release date +	* doc-jp/README: ditto +	* NEWS: update +	(2002-02-04  Fumitoshi UKAI  <ukai@debian.or.jp>)  	* [w3m-dev 02985] inputAnswer() and no "ssl_forbid_method"  	* file.c (inputAnswer): buf size is 80  	* url.c (openSSLHandle): if old_ssl_forbid_method == ssl_forbid_method  			ssl path is not modified -2002-02-04  Fumitoshi UKAI <ukai@debian.or.jp> - -	* [w3m-dev 02980] Re: code_to_str not found ifndef JP_CHARSET -	* backend.c (get_mime_charset_name): used only ifdef JP_CHARSET - -2002-02-04  Kazuhiko <kazuhiko@archi.kyoto-u.ac.jp> - -	* [w3m-dev 02979] code_to_str not found ifndef JP_CHARSET -	* file.c (print_internal_information): ifdef JP_CHARSET - -2002-02-03  Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> - -	* [w3m-dev 02967] parallel image downloading -	* fm.h (ImageCache): add touch, pid -	* image.c (getCharSize): retry fscanf -	* image.c (drawImage): retry fflush -	* image.c (MAX_LOAD_IMAGE): added, default 4 -	* image.c (image_cache): change to ImageCache** -	* image.c (image_lock): added -	* image.c (load_image_handler): signal SIGUSR1 -	* image.c (load_image_next): signal SIGUSR1 -	* image.c (loadImage): parallel image downloading -	* image.c (getImage): initialize touch, pid -	* image.c (getImageSize): return value is TRUE or FALSE -			retry fscanf - -2002-02-03  Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> - -	* [w3m-dev 02970] multiple -lnsl -lsocket -	* configure: merge bsdlib and extlib detection, use extlib only -		add ldflags to extlib -		(SYS_LIBRARIES): remove extlib -		(LOCAL_LIBRARIES): exlib only - -2002-02-03  TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp> - -	* [w3m-dev 02964] Print data of forms when halfdump option is set -	* backend.c (print_headers): print w3m-current-url and w3m-base-url -	* backend.c (print_formlist): deleted -	* backend.c (internal_get): remove "if (buf->formlist) {}" -	* file.c (print_internal_information): added -	* file.c (loadHTMLstream): if halfdump, print_internal_information -				if w3m_backend, print_internal_information -	* fm.h (DUMP_HALFEXTRA): added -	* main.c (-halfdump_extra): added - -2002-02-01  Dai Sato  <satodai@dog.intcul.tohoku.ac.jp> - +	(2002-02-01  Dai Sato  <satodai@dog.intcul.tohoku.ac.jp>)  	* [w3m-dev 02972] #include "config.h"  	* url.c, mktable.c: fix the order of including files -2002-02-01  Fumitoshi UKAI  <ukai@debian.or.jp> - +	(2002-02-01  Fumitoshi UKAI  <ukai@debian.or.jp>)  	* [w3m-dev 02968] fix problem with Netscape-Enterprise WWW-authenticate  	* file.c (findAuthentication): token is case insensitive -2002-02-01  Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> - -	* [w3m-dev 02961] halfdump image is not consistent -	* file.c (flushline): check f -	* file.c (do_blankline): fix blanklink conditions - -2002-02-01  Fumitoshi UKAI  <ukai@debian.or.jp> - -	* gcc -Wall -Werror safe -	* anchor.c (addMultirowsImg): unused variable: fi -	* display.c (redrawLineImage): unused variable: ncol -	* file.c (process_img): uninitialized variables: r2, ni, w0, i0, ismap -			unused variable: url, ext -	* file.c (loadHTMLstream): need volatile image_flag -	* image.c (image_index): int -	* image.c (getCharSize): need prototype -	* image.c (getImage): uninitialized variable: key -			return NULL -	* map.c (follow_map_menu): used only USE_IMAGE: px, py, map -	* map.c (newMapArea): used only USE_IMAGE: p, i, max -	* proto.h (addMultirowsImg): added -	* w3mimgdisplay.c (main): format string fix -	* w3mimgdisplay.c (DrawImage): need (Pixmap) cast - -	* inflate.c: indent - -2002-02-01  Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> - -	* w3m-img merge (w3m-0.2.4+cvs-1.278-img-2.2.patch.gz) -	* NEWS: w3m-img merge -	* .cvsignore: add w3mimgdisplay, w3mimgsize -	* XMakefile: add image.c to SRCS  -		     add image.o to OBJS -	             add IMGDISPLAY, IMGSIZE -	* config.h.dist: USE_IMAGE, IMGSIZE, IMGDISPLAY -	* configure: add find_imlib -			ask use_image -		(config.h) add $imgtarget to EXT_TARGETS -			   $def_use_image -			   IMGSIZE, IMGDISPLAY -	* fm.h (MAX_IMAGE): added -	* fm.h (DEFAULT_PIXEL_PER_CHAR): fix for USE_IMAGE -	* fm.h (DEFAULT_PIXEL_PER_LINE): added -	* fm.h (B_REDRAW_IMAGE): added -	* fm.h (IMG_FLAG_SKIP): added -	* fm.h (IMG_FLAG_AUTO): added -	* fm.h (IMG_FLAG_START): added -	* fm.h (IMG_FLAG_STOP): added -	* fm.h (IMG_FLAG_NEXT): added -	* fm.h (IMG_FLAG_UNLOADED): added -	* fm.h (IMG_FLAG_LOADED): added -	* fm.h (IMG_FLAG_ERROR): added -	* fm.h (MapArea): added -	* fm.h (MapList): s/urls/alts/, add area -	* fm.h (ImageCache): added -	* fm.h (Image): added -	* fm.h (Anchor): add image -	* fm.h (Buffer): add imarklist, image_flag, need_reshape -	* fm.h (RG_FRAME_SRC): added -	* fm.h (ALIGN_MIDDLE): added -	* fm.h (ALIGN_TOP): added -	* fm.h (ALIGN_BOTTOM): added -	* fm.h (QuietMessage): added -	* fm.h (Imgdisplay): added -	* fm.h (Imgsize): added -	* fm.h (activeImage): added -	* fm.h (displayImage): added -	* fm.h (autoImage): added -	* fm.h (useExtImageViewer): added -	* fm.h (image_source): added -	* fm.h (view_unseenobject): change default if USE_IMAGE -	* fm.h (set_pixel_per_char): added -	* fm.h (pixel_per_line): added -	* fm.h (set_pixel_per_line): added -	* fm.h (image_scale): added -	* proto.h (dispI): added -	* proto.h (stopI): added -	* proto.h (deleteImage): added -	* proto.h (getAllImage): added -	* proto.h (loadImage): added -	* proto.h (getImage): added -	* proto.h (getImageSize): added -	* proto.h (process_img): add width arg -	* proto.h (loadImageBuffer): added -	* proto.h (follow_map_menu): add a_img arg -	* proto.h (getMapXY): added -	* proto.h (newMapArea): added -	* proto.h (touch_cursor): added -	* proto.h (cURLcode): added -	* proto.h (initImage): added -	* proto.h (termImage): added -	* proto.h (addImage): added -	* proto.h (drawImage): added -	* proto.h (clearImage): added -	* anchor.c (addMultirowsImg): added -	* buffer.c (discardBuffer): deleteImage if USE_IMAGE -	* buffer.c (reshapeBuffer): buf->need_reshape check -	* display.c (fmTerm): if activeImage, stop load image -	* display.c (fmInit): if displayImage, initImage -	* display.c (image_touch): added -	* display.c (draw_image_flag): added -	* display.c (redrawLineImage): added -	* display.c (displayBuffer): buf->need_reshape = TRUE -				mode == B_REDRAW_IMAGE -				image flag checks -				force redraw image in mode == B_REDRAW_IMAGE -				displayBuffer if need reshape -				drawImage -	* display.c (redrawNLine): redrawLineImage -	* display.c (redrawLineImage): added -	* display.c (disp_message_nsec): return immediately if QuietMessage -	* etc.c (reset_signals): ignore SIGUSR1 -	* file.c (frame_source): added -	* file.c (_MoveFile): added -	* file.c (cur_baseURL): added -	* file.c (cur_document_code): added -	* file.c (cur_iseq): added -	* file.c (loadGeneralFile): fix fmInitialized and prevtrap checks -				save cur_baseURL -				image_source load -				loadImageBuffer for "image/*" -				frame_source flag -				fix b->type when proc is loadImageBuffer -	* file.c (process_img): add width arg -			parse height and width attr, align -			fix for inline-image -	* file.c (process_input): fix for form <input type="image"> -	* file.c (HTMLtagproc1): pass h_env->limit to process_img() -			fix <img_alt> for inline-image -			save cur_baseURL -	* file.c (HTMLlineproc2body): fix <img_alt> for inline-image -	* file.c (loadHTMLstream): fix for inline-image -			fix fmInitialized and prevtrap checks -			save cur_document_code -			save image_flag -	* file.c (loadGopherDir): save cur_document_code -			fix fmInitialized and prevtrap checks -	* file.c (loadImageBuffer): added for inline-image -	* file.c (save2tmp): fix fmInitialized and prevtrap checks -	* frame.c (frame_download_source): set RG_FRAME_SRC flag -			image check -	* funcname.tab (DISPLAY_IMAGE): added -	* funcname.tab (STOP_IMAGE): added -	* html.c (ALST_IMG): add align, ismap -	* html.c (ALST_AREA): add shape, coords -	* html.c (ALST_IMG_ALT): add width, height, usemap, ismap, hseq, -				xoffset, yoffset, top_margin, bottom_margin -	* html.c (AttrMap): add shape, coords, ismap, xoffset, yoffset -	* html.h (ATTR_SHAPE): added -	* html.h (ATTR_COORDS): added -	* html.h (ATTR_ISMAP): added -	* html.h (ATTR_XOFFSET): added -	* html.h (ATTR_YOFFSET): added -	* html.h (ATTR_TOP_MARGIN): added -	* html.h (ATTR_BOTTOM_MARGIN): added -	* html.h (SHAPE_UNKNOWN): added -	* html.h (SHAPE_DEFAULT): added -	* html.h (SHAPE_RECT): added -	* html.h (SHAPE_CIRCLE): added -	* html.h (SHAPE_POLY): added -	* image.c: added -	* main.c (fversion): add USE_IMAGE -	* main.c (fusage): -ppl option -	* main.c (MAIN): set_pixel_per_char if ppc specified -			-ppl option -			loadImage -	* main.c (pushBuffer): deleteImage -	* main.c (quitfm): termImage -	* main.c (selBuf): deleteImage -	* main.c (followA): fix for inline-image and map area -	* main.c (query_from_followform): getMapXY() -	* main.c (setOpt): displayBuffer B_REDRAW_IMAGE -	* main.c (follow_map): fix calculate x, y -	* main.c (dispI): added -	* main.c (stopI): added -	* map.c: include <math.h> -	* map.c (inMapArea): added -	* map.c (follow_map_menu): add a_img arg to handle inline-image -	* map.c (follow_map_panel): use MapArea -	* map.c (getMapXY): added -	* map.c (newMapArea): added -	* menu.c (smChBuf): deleteImage -	* parsetagx.c (toAlign): align top, bottom, middle -	* rc.c (P_SCALE): added -	* rc.c (CMT_PIXEL_PER_LINE): added -	* rc.c (CMT_DISP_IMAGE): added -	* rc.c (CMT_AUTO_IMAGE): added -	* rc.c (CMT_EXT_IMAGE_VIEWER): added -	* rc.c (CMT_IMAGE_SCALE): added -	* rc.c (CMT_IMGDISPLAY): added -	* rc.c (CMT_IMGSIZE): added -	* rc.c (show_param): P_PIXELS -	* rc.c (set_param): P_PIXELS -	* rc.c (sync_with_option): initImage -	* rc.c (to_str): P_PIXELS -	* table.c (feed_table_tag): fix <img> for inline-image -	* tagtable.tab (image): added -	* terms.c (wgetch): retry read when EINTR or EAGAIN -	* terms.c (touch_cursor): added -	* w3mimgdisplay.c: added -	* w3mimgsize.c: added -	* doc/README.func (DISPLAY_IMAGE): added -	* doc/README.func (STOP_IMAGE): added -	* doc/README.img: added -	* doc-jp/README.func (DISPLAY_IMAGE): added -	* doc-jp/README.func (STOP_IMAGE): added -	* doc-jp/README.img: added -	* scripts/w3mhelp.cgi.in: show dispI, stopI -	* scripts/multipart/multipart.cgi.in: inline image support -	 -2002-02-01  Fumitoshi UKAI  <ukai@debian.or.jp> - -	* version.c.in: 0.2.5+cvs -  2002-01-31  Fumitoshi UKAI  <ukai@debian.or.jp>  	* w3m 0.2.5 @@ -2794,4 +2507,4 @@  	* release-0-2-1  	* import w3m-0.2.1 -$Id: ChangeLog,v 1.299 2002/02/04 15:26:44 ukai Exp $ +$Id: ChangeLog,v 1.285.2.1 2002/02/04 16:26:27 ukai Exp $ @@ -1,11 +1,10 @@ -w3m 0.3? +w3m 0.2.5.1 - 2002-02-05 -* rc: max_load_image -* rc: display_image, auto_image, image_scale, imgdisplay, imgsize -* func: DISPLAY_IMAGE, STOP_IMAGE -* w3m-img merged: w3m now can display images! see doc/README.img +* backport from w3m/0.2.5+cvs-1.299 + - fix inputAnswer() and no "ssl_forbid_method" [w3m-dev 02985] + - fix SunOS 4.1.4 build problem [w3m-dev 02972] + - fix problem with Netscape-Enterprise WWW-authenticate [w3m-dev 02968] -----------------------------------------------------------------  w3m 0.2.5 - 2002-01-31  * RFC2617: HTTP Digest authentication diff --git a/doc-jp/README b/doc-jp/README index 9fb0a2b..db64df3 100644 --- a/doc-jp/README +++ b/doc-jp/README @@ -1,5 +1,5 @@ -	w3m: WWW wo Miru Tool  version 0.2.5 -		(C) Copyright by Akinori ITO	January 31, 2002 +	w3m: WWW wo Miru Tool  version 0.2.5.1 +		(C) Copyright by Akinori ITO	February 5, 2002  1. ¤Ï¤¸¤á¤Ë @@ -1,5 +1,5 @@ -	w3m: WWW wo Miru Tool  version 0.2.5 -		(C) Copyright by Akinori ITO	January 31, 2002 +	w3m: WWW wo Miru Tool  version 0.2.5.1 +		(C) Copyright by Akinori ITO	February 5, 2002  1. Introduction @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.63 2002/02/04 15:26:44 ukai Exp $ */ +/* $Id: file.c,v 1.54.2.1 2002/02/04 16:26:28 ukai Exp $ */  #include "fm.h"  #include <sys/types.h>  #include "myctype.h" @@ -25,9 +25,6 @@  #define min(a,b)        ((a) > (b) ? (b) : (a))  #endif				/* not min */ -static int frame_source = 0; - -static int _MoveFile(char *path1, char *path2);  static void uncompress_stream(URLFile *uf);  static FILE *lessopen_stream(char *path);  static Buffer *loadcmdout(char *cmd, @@ -50,13 +47,6 @@ static JMP_BUF AbortLoading;  static struct table *tables[MAX_TABLE];  static struct table_mode table_mode[MAX_TABLE]; -#ifdef USE_IMAGE -static ParsedURL *cur_baseURL = NULL; -#ifdef JP_CHARSET -static char cur_document_code; -#endif -#endif -  static Str cur_select;  static Str select_str;  static int select_is_multiple; @@ -123,9 +113,6 @@ static int form_sp = 0;  static int current_content_length;  static int cur_hseq; -#ifdef USE_IMAGE -static int cur_iseq; -#endif  #define MAX_UL_LEVEL 9  #ifdef KANJI_SYMBOLS @@ -1436,10 +1423,10 @@ 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.   	 */ -	if (fmInitialized) +	if (fmInitialized && prevtrap) {  	    term_raw(); -	if (prevtrap)  	    signal(SIGINT, prevtrap); +	}  	switch (f.scheme) {  	case SCM_FTPDIR:  	    { @@ -1514,9 +1501,10 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,      /* openURL() succeeded */      if (SETJMP(AbortLoading) != 0) {  	/* transfer interrupted */ -	if (fmInitialized) +	if (fmInitialized) {  	    term_raw(); -	signal(SIGINT, prevtrap); +	    signal(SIGINT, prevtrap); +	}  	if (b)  	    discardBuffer(b);  	UFclose(&f); @@ -1531,9 +1519,10 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,      }      if (header_string)  	header_string = NULL; -    prevtrap = signal(SIGINT, KeyAbort); -    if (fmInitialized) +    if (fmInitialized) { +	prevtrap = signal(SIGINT, KeyAbort);  	term_cbreak(); +    }      if (pu.scheme == SCM_HTTP ||  #ifdef USE_SSL  	pu.scheme == SCM_HTTPS || @@ -1766,17 +1755,14 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,      if (real_type == NULL)  	real_type = t;      proc = loadBuffer; -#ifdef USE_IMAGE -    cur_baseURL = New(ParsedURL); -    copyParsedURL(cur_baseURL, &pu); -#endif      if (do_download) {  	/* download only */  	char *file; -	if (fmInitialized) +	if (fmInitialized) {  	    term_raw(); -	signal(SIGINT, prevtrap); +	    signal(SIGINT, prevtrap); +	}  	if (DecodeCTE && IStype(f.stream) != IST_ENCODED)  	    f.stream = newEncodedStream(f.stream, f.encoding);  	if (pu.scheme == SCM_LOCAL) @@ -1800,33 +1786,11 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,  	    f.compression = CMP_NOCOMPRESS;  	}      } -#ifdef USE_IMAGE -    if (image_source) { -	Buffer *b = NULL; -	if (IStype(f.stream) != IST_ENCODED) -	    f.stream = newEncodedStream(f.stream, f.encoding); -	if (save2tmp(f, image_source) == 0) { -	    b = newBuffer(INIT_BUFFER_WIDTH); -	    b->sourcefile = image_source; -	    b->real_type = t; -	} -	if (fmInitialized) -	    term_raw(); -	signal(SIGINT, prevtrap); -	UFclose(&f); -	return b; -    } -#endif      if (!strcasecmp(t, "text/html"))  	proc = loadHTMLBuffer;      else if (is_plain_text_type(t))  	proc = loadBuffer; -#ifdef USE_IMAGE -    else if (activeImage && displayImage && !useExtImageViewer && -	     !w3m_dump && !strncasecmp(t, "image/", 6)) -	proc = loadImageBuffer; -#endif  #ifdef USE_GOPHER      else if (!strcasecmp(t, "gopher:directory")) {  	proc = loadGopherDir; @@ -1844,15 +1808,17 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,  		    copyParsedURL(&b->currentURL, &pu);  	    }  	    UFclose(&f); -	    if (fmInitialized) +	    if (fmInitialized) {  		term_raw(); -	    signal(SIGINT, prevtrap); +		signal(SIGINT, prevtrap); +	    }  	    return b;  	}  	else { -	    if (fmInitialized) +	    if (fmInitialized) {  		term_raw(); -	    signal(SIGINT, prevtrap); +		signal(SIGINT, prevtrap); +	    }  	    if (pu.scheme == SCM_LOCAL) {  		UFclose(&f);  		doFileCopy(pu.real_file, @@ -1886,9 +1852,7 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,  	    t_buf->ssl_certificate = s->ptr;      }  #endif -    frame_source = flag & RG_FRAME_SRC;      b = loadSomething(&f, pu.real_file ? pu.real_file : pu.file, proc, t_buf); -    frame_source = 0;      UFclose(&f);      if (b) {  	b->real_scheme = f.scheme; @@ -1902,10 +1866,6 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,  	    Str s = Strnew_charp(t);  	    b->type = s->ptr;  	} -#ifdef USE_IMAGE -	else if (proc == loadImageBuffer) -	    b->type = b->real_type; -#endif  	else  	    b->type = "text/plain";  	if (pu.label) { @@ -1940,9 +1900,10 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,      }      if (header_string)  	header_string = NULL; -    if (fmInitialized) +    if (fmInitialized) {  	term_raw(); -    signal(SIGINT, prevtrap); +	signal(SIGINT, prevtrap); +    }      return b;  } @@ -2504,7 +2465,7 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,  	    h_env->maxlimit = lbuf->pos;  	if (buf)  	    pushTextLine(buf, lbuf); -	else if (f) { +	else {  	    Strfputs(lbuf->line, f);  	    fputc('\n', f);  	} @@ -2520,16 +2481,15 @@ flushline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent,  #define APPEND(str) \  	if (buf) \  	    appendTextLine(buf,(str),0); \ -	else if (f) \ +	else \  	    Strfputs((str),f)  	while (*p) {  	    q = p;  	    if (sloppy_parse_line(&p)) {  		Strcat_charp_n(tmp, q, p - q); -		if (force == 2) { +		if (force == 2)  		    APPEND(tmp); -		}  		else  		    Strcat(tmp2, tmp);  		Strclear(tmp); @@ -2625,7 +2585,9 @@ void  do_blankline(struct html_feed_environ *h_env, struct readbuffer *obuf,  	     int indent, int indent_incr, int width)  { -    if (h_env->blank_lines == 0) +    if (h_env->buf && h_env->blank_lines == 0) +	flushline(h_env, obuf, indent, 1, width); +    else if (h_env->f)  	flushline(h_env, obuf, indent, 1, width);  } @@ -2750,18 +2712,12 @@ restore_fonteffect(struct html_feed_environ *h_env, struct readbuffer *obuf)  	push_tag(obuf, "<u>", HTML_U);  } +  Str -process_img(struct parsed_tag *tag, int width) +process_img(struct parsed_tag *tag)  { -    char *p, *q, *r, *r2 = NULL, *s; -#ifdef USE_IMAGE -    int w, i, nw, ni = 1, n, w0 = -1, i0 = -1; -    int align, xoffset, yoffset, top, bottom, ismap = 0; -    int use_image = activeImage && displayImage; -#else -    int w, i, nw, n; -#endif -    int pre_int = FALSE; +    char *p, *q, *r, *r2, *s; +    int w, i;      Str tmp = Strnew();      if (!parsedtag_get_value(tag, ATTR_SRC, &p)) @@ -2769,237 +2725,69 @@ process_img(struct parsed_tag *tag, int width)      q = NULL;      parsedtag_get_value(tag, ATTR_ALT, &q);      w = -1; -    if (parsedtag_get_value(tag, ATTR_WIDTH, &w)) { -	if (w < 0) { -	    if (width > 0) -		w = (int)(-width * pixel_per_char * w / 100 + 0.5); -	    else -		w = -1; -	} -#ifdef USE_IMAGE -	if (use_image) { -	    if (w > 0) { -		w = (int)(w * image_scale / 100 + 0.5); -		if (w == 0) -		    w = 1; -	    } -	} -#endif -    } -#ifdef USE_IMAGE -    if (use_image) { -	i = -1; -	if (parsedtag_get_value(tag, ATTR_HEIGHT, &i)) { -	    if (i > 0) { -		i = (int)(i * image_scale / 100 + 0.5); -		if (i == 0) -		    i = 1; -	    } -	    else { -		i = -1; -	    } -	} -	align = -1; -	parsedtag_get_value(tag, ATTR_ALIGN, &align); -	ismap = 0; -	if (parsedtag_exists(tag, ATTR_ISMAP)) -	    ismap = 1; -    } -    else -#endif -	parsedtag_get_value(tag, ATTR_HEIGHT, &i); +    parsedtag_get_value(tag, ATTR_WIDTH, &w); +    i = -1; +    parsedtag_get_value(tag, ATTR_HEIGHT, &i);      r = NULL;      parsedtag_get_value(tag, ATTR_USEMAP, &r);      tmp = Strnew_size(128); -#ifdef USE_IMAGE -    if (use_image) { -	switch (align) { -	case ALIGN_LEFT: -	    Strcat_charp(tmp, "<div align=left>"); -	    break; -	case ALIGN_CENTER: -	    Strcat_charp(tmp, "<div align=center>"); -	    break; -	case ALIGN_RIGHT: -	    Strcat_charp(tmp, "<div align=right>"); -	    break; -	} -    } -#endif      if (r) {  	r2 = strchr(r, '#');  	s = "<form_int method=internal action=map>";  	process_form(parse_tag(&s, TRUE)); -	Strcat(tmp, Sprintf("<input_alt fid=\"%d\" " +	Strcat(tmp, Sprintf("<pre_int><input_alt fid=\"%d\" "  			    "type=hidden name=link value=\"", cur_form_id));  	Strcat_charp(tmp, html_quote((r2) ? r2 + 1 : r));  	Strcat(tmp, Sprintf("\"><input_alt hseq=\"%d\" fid=\"%d\" "  			    "type=submit no_effect=true>",  			    cur_hseq++, cur_form_id));      } -#ifdef USE_IMAGE -    if (use_image) { -	w0 = w; -	i0 = i; -	if (w < 0 || i < 0) { -	    Image image; -	    ParsedURL u; - -#ifdef JP_CHARSET -	    parseURL2(conv(p, InnerCode, cur_document_code)->ptr, &u, -		      cur_baseURL); -#else -	    parseURL2(p, &u, cur_baseURL); -#endif -	    image.url = parsedURL2Str(&u)->ptr; -	    image.ext = filename_extension(u.file, TRUE); -	    image.cache = NULL; -	    image.width = w; -	    image.height = i; - -	    image.cache = getImage(&image, cur_baseURL, IMG_FLAG_SKIP); -	    if (image.cache && image.cache->width > 0 && -		image.cache->height > 0) { -		w = w0 = image.cache->width; -		i = i0 = image.cache->height; -	    } -	    if (w < 0) -		w = 8 * pixel_per_char; -	    if (i < 0) -		i = pixel_per_line; -	} -	nw = (w > 3) ? (int)((w - 3) / pixel_per_char + 1) : 1; -	ni = (i > 3) ? (int)((i - 3) / pixel_per_line + 1) : 1; -	Strcat(tmp, -	       Sprintf("<pre_int><img_alt hseq=\"%d\" src=\"", cur_iseq++)); -	pre_int = TRUE; -    } -    else -#endif -    { -	if (w < 0) -	    w = 12 * pixel_per_char; -	nw = w ? (int)((w - 1) / pixel_per_char + 1) : 1; -	if (r) { -	    Strcat_charp(tmp, "<pre_int>"); -	    pre_int = TRUE; -	} -	Strcat_charp(tmp, "<img_alt src=\""); -    } -    Strcat_charp(tmp, html_quote(p)); -    Strcat_charp(tmp, "\""); -#ifdef USE_IMAGE -    if (use_image) { -	if (w0 >= 0) -	    Strcat(tmp, Sprintf(" width=%d", w0)); -	if (i0 >= 0) -	    Strcat(tmp, Sprintf(" height=%d", i0)); -	switch (align) { -	case ALIGN_TOP: -	    top = 0; -	    bottom = ni - 1; -	    yoffset = 0; -	    break; -	case ALIGN_MIDDLE: -	    top = ni / 2; -	    bottom = top; -	    if (top * 2 == ni) -		yoffset = (int)(((ni + 1) * pixel_per_line - i) / 2); -	    else -		yoffset = (int)((ni * pixel_per_line - i) / 2); -	    break; -	case ALIGN_BOTTOM: -	    top = ni - 1; -	    bottom = 0; -	    yoffset = (int)(ni * pixel_per_line - i); -	    break; -	default: -	    top = ni - 1; -	    bottom = 0; -	    if (ni == 1 && ni * pixel_per_line > i) -		yoffset = 0; -	    else { -		yoffset = (int)(ni * pixel_per_line - i); -		if (yoffset <= -2) -		    yoffset++; -	    } -	    break; -	} -	xoffset = (int)((nw * pixel_per_char - w) / 2); -	if (xoffset) -	    Strcat(tmp, Sprintf(" xoffset=%d", xoffset)); -	if (yoffset) -	    Strcat(tmp, Sprintf(" yoffset=%d", yoffset)); -	if (top) -	    Strcat(tmp, Sprintf(" top_margin=%d", top)); -	if (bottom) -	    Strcat(tmp, Sprintf(" bottom_margin=%d", bottom)); -	if (r) { -	    Strcat_charp(tmp, " usemap=\""); -	    Strcat_charp(tmp, html_quote((r2) ? r2 + 1 : r)); -	    Strcat_charp(tmp, "\""); -	} -	if (ismap) -	    Strcat_charp(tmp, " ismap"); -    } -#endif -    Strcat_charp(tmp, ">");      if (q != NULL && *q == '\0' && ignore_null_img_alt)  	q = NULL; +    if (q != NULL || r != NULL) +	Strcat_charp(tmp, "<img_alt src=\""); +    else +	Strcat_charp(tmp, "<nobr><img_alt src=\""); +    Strcat_charp(tmp, html_quote(p)); +    Strcat_charp(tmp, "\">");      if (q != NULL) { -	n = strlen(q); -#ifdef USE_IMAGE -	if (use_image) { -	    if (n > nw) { -		n = nw; -		Strcat_charp(tmp, html_quote(Strnew_charp_n(q, nw)->ptr)); -	    } -	    else -		Strcat_charp(tmp, q); -	} -	else -#endif -	    Strcat_charp(tmp, q); -	goto img_end; +	Strcat_charp(tmp, html_quote(q)); +	Strcat_charp(tmp, "</img_alt> "); +	goto img_end2;      }      if (w > 0 && i > 0) {  	/* guess what the image is! */  	if (w < 32 && i < 48) {  	    /* must be an icon or space */ -	    n = 1;  	    if (strcasestr(p, "space") || strcasestr(p, "blank")) -		Strcat_charp(tmp, "_"); +		Strcat_charp(tmp, "_</img_alt>");  	    else {  		if (w * i < 8 * 16) -		    Strcat_charp(tmp, "*"); +		    Strcat_charp(tmp, "*</img_alt>");  		else {  #ifdef KANJI_SYMBOLS -		    Strcat_charp(tmp, "¡ü"); -		    n = 2; +		    Strcat_charp(tmp, "¡ü</img_alt>");  #else				/* not KANJI_SYMBOLS */ -		    Strcat_charp(tmp, "#"); +		    Strcat_charp(tmp, "#</img_alt>");  #endif				/* not KANJI_SYMBOLS */  		}  	    } -	    goto img_end; +	    goto img_end1;  	}  	if (w > 200 && i < 13) {  	    /* must be a horizontal line */ -	    if (!pre_int) { -		Strcat_charp(tmp, "<pre_int>"); -		pre_int = TRUE; -	    }  #ifndef KANJI_SYMBOLS  	    Strcat_charp(tmp, "<_RULE TYPE=10>");  #endif				/* not KANJI_SYMBOLS */ -	    for (i = 0; i < nw - (HR_RULE_WIDTH - 1); i += HR_RULE_WIDTH) +	    w /= pixel_per_char; +	    for (i = 0; i < w - (HR_RULE_WIDTH - 1); i += HR_RULE_WIDTH)  		Strcat_charp(tmp, HR_RULE);  #ifndef KANJI_SYMBOLS  	    Strcat_charp(tmp, "</_RULE>");  #endif				/* not KANJI_SYMBOLS */ -	    n = i; -	    goto img_end; +	    Strcat_charp(tmp, "</img_alt>"); +	    goto img_end1;  	}      }      for (q = p; *q; q++) ; @@ -3008,44 +2796,27 @@ process_img(struct parsed_tag *tag, int width)      if (*q == '/')  	q++;      Strcat_char(tmp, '['); -    n = 1;      p = q;      for (; *q; q++) {  	if (!IS_ALNUM(*q) && *q != '_' && *q != '-') {  	    break;  	} -	Strcat_char(tmp, *q); -	n++; -	if (n + 1 >= nw) +	else if (w > 0 && !IS_ALNUM(*q) +		 && q - p + 2 > (int)(w / pixel_per_char)) { +	    Strcat_charp(tmp, "..");  	    break; +	} +	Strcat_char(tmp, *q);      } -    Strcat_char(tmp, ']'); -    n++; -  img_end: -#ifdef USE_IMAGE -    if (use_image) { -	for (; n < nw; n++) -	    Strcat_char(tmp, ' '); -    } -#endif -    Strcat_charp(tmp, "</img_alt>"); -    if (pre_int) -	Strcat_charp(tmp, "</pre_int>"); +    Strcat_charp(tmp, "]</img_alt>"); +  img_end1: +    if (r == NULL) +	Strcat_charp(tmp, "</nobr>"); +  img_end2:      if (r) { -	Strcat_charp(tmp, "</input_alt>"); +	Strcat_charp(tmp, "</input_alt></pre_int>");  	process_n_form();      } -#ifdef USE_IMAGE -    if (use_image) { -	switch (align) { -	case ALIGN_RIGHT: -	case ALIGN_CENTER: -	case ALIGN_LEFT: -	    Strcat_charp(tmp, "</div>"); -	    break; -	} -    } -#endif      return tmp;  } @@ -3067,7 +2838,8 @@ Str  process_input(struct parsed_tag *tag)  {      int i, w, v, x, y, z, iw, ih; -    char *q, *p, *r, *p2, *s; +    char *q, *p, *r, *p2; +    char *pi = NULL;      Str tmp;      char *qq = "";      int qlen = 0; @@ -3156,20 +2928,6 @@ process_input(struct parsed_tag *tag)  	    Strcat_charp(tmp, "<u>");  	    break;  	case FORM_INPUT_IMAGE: -	    s = NULL; -	    parsedtag_get_value(tag, ATTR_SRC, &s); -	    if (s) { -		Strcat(tmp, Sprintf("<img src=\"%s\"", html_quote(s))); -		if (p2) -		    Strcat(tmp, Sprintf(" alt=\"%s\"", html_quote(p2))); -		if (parsedtag_get_value(tag, ATTR_WIDTH, &iw)) -		    Strcat(tmp, Sprintf(" width=\"%d\"", iw)); -		if (parsedtag_get_value(tag, ATTR_HEIGHT, &ih)) -		    Strcat(tmp, Sprintf(" height=\"%d\"", ih)); -		Strcat_charp(tmp, ">"); -		Strcat_charp(tmp, "</input_alt></pre_int>"); -		return tmp; -	    }  	case FORM_INPUT_SUBMIT:  	case FORM_INPUT_BUTTON:  	case FORM_INPUT_RESET: @@ -3195,6 +2953,23 @@ process_input(struct parsed_tag *tag)  		    Strcat_char(tmp, ' ');  	    }  	    break; +	case FORM_INPUT_IMAGE: +	    parsedtag_get_value(tag, ATTR_SRC, &pi); +	    if (pi) { +		Strcat(tmp, Sprintf("<img_alt src=\"%s\"", html_quote(pi))); +		if (parsedtag_get_value(tag, ATTR_WIDTH, &iw)) +		    Strcat(tmp, Sprintf(" width=\"%d\"", iw)); +		if (parsedtag_get_value(tag, ATTR_HEIGHT, &ih)) +		    Strcat(tmp, Sprintf(" height=\"%d\"", ih)); +		Strcat_charp(tmp, ">"); +		if (p2) +		    Strcat_charp(tmp, html_quote(p2)); +		else +		    Strcat_charp(tmp, qq); +		Strcat_charp(tmp, "</img_alt>"); +		break; +	    } +	    /* FALL THROUGH */  	case FORM_INPUT_SUBMIT:  	case FORM_INPUT_BUTTON:  	    if (p2) @@ -4191,24 +3966,12 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)  	close_anchor(h_env, obuf);  	return 1;      case HTML_IMG: -	tmp = process_img(tag, h_env->limit); +	tmp = process_img(tag);  	HTMLlineproc1(tmp->ptr, h_env);  	return 1;      case HTML_IMG_ALT:  	if (parsedtag_get_value(tag, ATTR_SRC, &p))  	    obuf->img_alt = Strnew_charp(p); -#ifdef USE_IMAGE -	i = 0; -	if (parsedtag_get_value(tag, ATTR_TOP_MARGIN, &i)) { -	    if (i > obuf->top_margin) -		obuf->top_margin = i; -	} -	i = 0; -	if (parsedtag_get_value(tag, ATTR_BOTTOM_MARGIN, &i)) { -	    if (i > obuf->bottom_margin) -		obuf->bottom_margin = i; -	} -#endif  	return 0;      case HTML_N_IMG_ALT:  	if (obuf->img_alt) { @@ -4440,14 +4203,6 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)  	}  	return 1;      case HTML_BASE: -#ifdef USE_IMAGE -	p = NULL; -	if (parsedtag_get_value(tag, ATTR_HREF, &p)) { -	    if (!cur_baseURL) -		cur_baseURL = New(ParsedURL); -	    parseURL(p, cur_baseURL, NULL); -	} -#endif      case HTML_MAP:      case HTML_N_MAP:      case HTML_AREA: @@ -4539,7 +4294,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)  {      Anchor *a_href = NULL, *a_img = NULL, *a_form = NULL;      char outc[LINELEN]; -    char *p, *q, *r, *s, *str; +    char *p, *q, *r, *str;      Lineprop outp[LINELEN], mode, effect;      int pos;      int nlines; @@ -4695,67 +4450,9 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)  		    break;  		case HTML_IMG_ALT:  		    if (parsedtag_get_value(tag, ATTR_SRC, &p)) { -#ifdef USE_IMAGE -			int w = -1, h = -1, iseq = 0, ismap = 0; -			int xoffset = 0, yoffset = 0, top = 0, bottom = 0; -			parsedtag_get_value(tag, ATTR_HSEQ, &iseq); -			parsedtag_get_value(tag, ATTR_WIDTH, &w); -			parsedtag_get_value(tag, ATTR_HEIGHT, &h); -			parsedtag_get_value(tag, ATTR_XOFFSET, &xoffset); -			parsedtag_get_value(tag, ATTR_YOFFSET, &yoffset); -			parsedtag_get_value(tag, ATTR_TOP_MARGIN, &top); -			parsedtag_get_value(tag, ATTR_BOTTOM_MARGIN, &bottom); -			if (parsedtag_exists(tag, ATTR_ISMAP)) -			    ismap = 1; -			q = NULL; -			parsedtag_get_value(tag, ATTR_USEMAP, &q); -			if (iseq > 0) { -			    buf->imarklist = putHmarker(buf->imarklist, -							currentLn(buf), pos, -							iseq - 1); -			} -#endif  			p = remove_space(p);  			p = url_quote_conv(p, buf->document_code);  			a_img = registerImg(buf, p, currentLn(buf), pos); -#ifdef USE_IMAGE -			a_img->hseq = iseq; -			a_img->image = NULL; -			if (iseq > 0) { -			    ParsedURL u; -			    Image *image; - -			    parseURL2(a_img->url, &u, cur_baseURL); -			    a_img->image = image = New(Image); -			    image->url = parsedURL2Str(&u)->ptr; -			    image->ext = filename_extension(u.file, TRUE); -			    image->cache = NULL; -			    image->width = w; -			    image->height = h; -			    image->xoffset = xoffset; -			    image->yoffset = yoffset; -			    image->y = currentLn(buf) - top; -			    if (image->xoffset < 0 && pos == 0) -				image->xoffset = 0; -			    if (image->yoffset < 0 && image->y == 1) -				image->yoffset = 0; -			    image->rows = 1 + top + bottom; -			    image->map = q; -			    image->ismap = ismap; -			    image->touch = 0; -			    image->cache = getImage(image, cur_baseURL, -						    IMG_FLAG_SKIP); -			} -			else if (iseq < 0) { -			    BufferPoint *po = buf->imarklist->marks - iseq - 1; -			    Anchor *a = retrieveAnchor(buf->img, -						       po->line, po->pos); -			    if (a) { -				a_img->url = a->url; -				a_img->image = a->image; -			    } -			} -#endif  		    }  		    effect |= PE_IMAGE;  		    break; @@ -4817,8 +4514,9 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)  		    if (parsedtag_get_value(tag, ATTR_NAME, &p)) {  			MapList *m = New(MapList);  			m->name = Strnew_charp(p); -			m->area = newGeneralList();  			m->next = buf->maplist; +			m->urls = newTextList(); +			m->alts = newTextList();  			buf->maplist = m;  		    }  		    break; @@ -4829,19 +4527,13 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)  		    if (buf->maplist == NULL)	/* outside of <map>..</map> */  			break;  		    if (parsedtag_get_value(tag, ATTR_HREF, &p)) { -			MapArea *a;  			p = remove_space(p);  			p = url_quote_conv(p, buf->document_code); -			q = ""; -			parsedtag_get_value(tag, ATTR_ALT, &q); -			r = NULL; -			s = NULL; -#ifdef USE_IMAGE -			parsedtag_get_value(tag, ATTR_SHAPE, &r); -			parsedtag_get_value(tag, ATTR_COORDS, &s); -#endif -			a = newMapArea(p, q, r, s); -			pushValue(buf->maplist->area, (void *)a); +			pushText(buf->maplist->urls, p); +			if (parsedtag_get_value(tag, ATTR_ALT, &q)) +			    pushText(buf->maplist->alts, q); +			else +			    pushText(buf->maplist->alts, "");  		    }  		    break;  		case HTML_FRAMESET: @@ -4942,9 +4634,6 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)  	fclose(debug);      if (n_textarea)  	addMultirowsForm(buf, buf->formitem); -#ifdef USE_IMAGE -    addMultirowsImg(buf, buf->img); -#endif  }  void @@ -5716,69 +5405,6 @@ completeHTMLstream(struct html_feed_environ *h_env, struct readbuffer *obuf)      }  } -static void -print_internal_information(struct html_feed_environ *henv) -{ -    int i; -    Str s; -    TextLineList *tl = newTextLineList(); - -    if (form_max >= 0) { -	FormList *fp; -	for (i = 0; i <= form_max; i++) { -	    fp = forms[i]; -	    s = Sprintf("<form_int fid=\"%d\" action=\"%s\" method=\"%s\"", -			i, fp->action->ptr, -			(fp->method == FORM_METHOD_POST) ? "post" -			: ((fp->method == -			    FORM_METHOD_INTERNAL) ? "internal" : "get")); -	    if (fp->target) -		Strcat(s, Sprintf(" target=\"%s\"", fp->target)); -#ifdef JP_CHARSET -	    if (fp->charset) -		Strcat(s, -		       Sprintf(" accept-charset=\"%s\"", -			       code_to_str(fp->charset))); -#endif -	    if (fp->enctype == FORM_ENCTYPE_MULTIPART) -		Strcat_charp(s, " enctype=multipart/form-data"); -	    Strcat_charp(s, ">"); -	    pushTextLine(tl, newTextLine(s, 0)); -	} -    } -#ifdef MENU_SELECT -    if (n_select > 0) { -	FormSelectOptionItem *ip; -	for (i = 0; i < n_select; i++) { -	    for (ip = select_option[i].first; ip; ip = ip->next) { -		s = Sprintf("<option_int selectnumber=%d" -			    " value=\"%s\"%s>%s</option_int>", -			    i, -			    html_quote(ip->value ? ip->value->ptr : ip->label-> -				       ptr), ip->checked ? " selected" : "", -			    ip->label->ptr); -		pushTextLine(tl, newTextLine(s, 0)); -	    } -	} -    } -#endif				/* MENU_SELECT */ -    if (n_textarea > 0) { -	for (i = 0; i < n_textarea; i++) { -	    s = Sprintf("<textarea_int textareanumber=%d>%s</textarea_int>", -			i, textarea_str[i]->ptr); -	    pushTextLine(tl, newTextLine(s, 0)); -	} -    } - -    if (henv->buf) -	appendTextLineList(henv->buf, tl); -    else if (henv->f) { -	TextLineListItem *p; -	for (p = tl->first; p; p = p->next) -	    fprintf(henv->f, "%s\n", p->ptr->line->ptr); -    } -} -  void  loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)  { @@ -5789,9 +5415,6 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)      char code;      struct html_feed_environ htmlenv1;      struct readbuffer obuf; -#ifdef USE_IMAGE -    int volatile image_flag; -#endif      MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL;      n_textarea = 0; @@ -5809,17 +5432,6 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)      forms_size = 0;      forms = NULL;      cur_hseq = 1; -#ifdef USE_IMAGE -    cur_iseq = 1; -    if (newBuf->image_flag) -	image_flag = newBuf->image_flag; -    else if (activeImage && displayImage && autoImage) -	image_flag = IMG_FLAG_AUTO; -    else -	image_flag = IMG_FLAG_SKIP; -    if (newBuf->currentURL.file) -	cur_baseURL = baseURL(newBuf); -#endif      if (w3m_halfload) {  	newBuf->buffername = "---"; @@ -5828,9 +5440,10 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)  #endif				/* JP_CHARSET */  	HTMLlineproc3(newBuf, f->stream);  	w3m_halfload = FALSE; -	if (fmInitialized) +	if (fmInitialized) {  	    term_raw(); -	signal(SIGINT, prevtrap); +	    signal(SIGINT, prevtrap); +	}  	return;      } @@ -5845,9 +5458,10 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)  	HTMLlineproc1("<br>Transfer Interrupted!<br>", &htmlenv1);  	goto phase2;      } -    prevtrap = signal(SIGINT, KeyAbort); -    if (fmInitialized) +    if (fmInitialized) { +	prevtrap = signal(SIGINT, KeyAbort);  	term_cbreak(); +    }  #ifdef JP_CHARSET      if (newBuf != NULL && newBuf->document_code != '\0') @@ -5868,32 +5482,16 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)  	if (src)  	    Strfputs(lineBuf2, src);  	linelen += lineBuf2->length; -	if (w3m_dump & DUMP_SOURCE) -	    continue;  	showProgress(&linelen, &trbyte); -	/* -	 * if (frame_source) -	 * continue; -	 */  #ifdef JP_CHARSET  	if (meta_charset != '\0') {	/* <META> */ -	    if (content_charset == '\0' && UseContentCharset) { +	    if (content_charset == '\0' && UseContentCharset)  		code = meta_charset; -#ifdef USE_IMAGE -		cur_document_code = code; -#endif -	    }  	    meta_charset = '\0';  	}  #endif -	if (!internal) { +	if (!internal)  	    lineBuf2 = convertLine(f, lineBuf2, &code, HTML_MODE); -#ifdef JP_CHARSET -#ifdef USE_IMAGE -	    cur_document_code = code; -#endif -#endif -	}  #ifdef USE_NNTP  	if (f->scheme == SCM_NEWS) {  	    if (Str_news_endline(lineBuf2)) { @@ -5912,30 +5510,24 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)      if (htmlenv1.title)  	newBuf->buffername = htmlenv1.title;      if (w3m_halfdump) { -	if (fmInitialized) +	if (fmInitialized) {  	    term_raw(); -	signal(SIGINT, prevtrap); -	if (w3m_dump & DUMP_HALFEXTRA) -	    print_internal_information(&htmlenv1); -	return; -    } -    if (w3m_backend) { -	print_internal_information(&htmlenv1); -	backend_halfdump_buf = htmlenv1.buf; +	    signal(SIGINT, prevtrap); +	}  	return;      }    phase2:      newBuf->trbyte = trbyte + linelen; -    if (fmInitialized) +    if (fmInitialized) {  	term_raw(); -    signal(SIGINT, prevtrap); +	signal(SIGINT, prevtrap); +    }  #ifdef JP_CHARSET      newBuf->document_code = code;      content_charset = '\0';  #endif				/* JP_CHARSET */ -#ifdef USE_IMAGE -    newBuf->image_flag = image_flag; -#endif +    if (w3m_backend) +	backend_halfdump_buf = htmlenv1.buf;      HTMLlineproc2(newBuf, htmlenv1.buf);  } @@ -5953,18 +5545,15 @@ loadHTMLString(Str page)      newBuf = newBuffer(INIT_BUFFER_WIDTH);      if (SETJMP(AbortLoading) != 0) { -	if (fmInitialized) -	    term_raw(); -	signal(SIGINT, prevtrap);  	discardBuffer(newBuf);  	return NULL;      } -    prevtrap = signal(SIGINT, KeyAbort); -    if (fmInitialized) -	term_cbreak(); -      init_stream(&f, SCM_LOCAL, newStrStream(page)); +    if (fmInitialized) { +	prevtrap = signal(SIGINT, KeyAbort); +	term_cbreak(); +    }      if (w3m_dump & DUMP_FRAME) {  	tmp = tmpfname(TMPF_SRC, ".html");  	pushText(fileToDelete, tmp->ptr); @@ -5975,9 +5564,10 @@ loadHTMLString(Str page)      loadHTMLstream(&f, newBuf, src, TRUE); -    if (fmInitialized) +    if (fmInitialized) {  	term_raw(); -    signal(SIGINT, prevtrap); +	signal(SIGINT, prevtrap); +    }      newBuf->topLine = newBuf->firstLine;      newBuf->lastLine = newBuf->currentLine;      newBuf->currentLine = newBuf->firstLine; @@ -6021,9 +5611,6 @@ loadGopherDir(URLFile *uf, Buffer *newBuf)  	code = content_charset;      else  	code = DocumentCode; -#ifdef USE_IMAGE -    cur_document_code = code; -#endif      content_charset = '\0';  #endif      while (1) { @@ -6127,9 +5714,10 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf)      if (SETJMP(AbortLoading) != 0) {  	goto _end;      } -    prevtrap = signal(SIGINT, KeyAbort); -    if (fmInitialized) +    if (fmInitialized) { +	prevtrap = signal(SIGINT, KeyAbort);  	term_cbreak(); +    }      if (newBuf->sourcefile == NULL &&  	(uf->scheme != SCM_LOCAL || newBuf->mailcap)) { @@ -6155,11 +5743,7 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf)  	if (src)  	    Strfputs(lineBuf2, src);  	linelen += lineBuf2->length; -	if (w3m_dump & DUMP_SOURCE) -	    continue;  	showProgress(&linelen, &trbyte); -	if (frame_source) -	    continue;  	lineBuf2 = convertLine(uf, lineBuf2, &code, PAGER_MODE);  	if (squeezeBlankLine) {  	    if (lineBuf2->ptr[0] == '\n' && pre_lbuf == '\n') { @@ -6190,9 +5774,10 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf)  		   lineBuf2->length, nlines);      }    _end: -    if (fmInitialized) +    if (fmInitialized) { +	signal(SIGINT, prevtrap);  	term_raw(); -    signal(SIGINT, prevtrap); +    }      newBuf->topLine = newBuf->firstLine;      newBuf->lastLine = newBuf->currentLine;      newBuf->currentLine = newBuf->firstLine; @@ -6206,67 +5791,6 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf)      return newBuf;  } -#ifdef USE_IMAGE -Buffer * -loadImageBuffer(URLFile *uf, Buffer *newBuf) -{ -    Image *image; -    ImageCache *cache; -    Str tmp, tmpf; -    FILE *src = NULL; -    URLFile f; -    MySignalHandler(*prevtrap) (); - -    loadImage(IMG_FLAG_STOP); -    image = New(Image); -    image->url = parsedURL2Str(cur_baseURL)->ptr; -    image->ext = filename_extension(cur_baseURL->file, 1); -    image->width = -1; -    image->height = -1; -    cache = getImage(image, cur_baseURL, IMG_FLAG_AUTO); -    if (!cur_baseURL->is_nocache && cache->loaded == IMG_FLAG_LOADED) -	goto image_buffer; - -    prevtrap = signal(SIGINT, KeyAbort); -    if (fmInitialized) -	term_cbreak(); -    if (IStype(uf->stream) != IST_ENCODED) -	uf->stream = newEncodedStream(uf->stream, uf->encoding); -    if (save2tmp(*uf, cache->file) < 0) { -	if (fmInitialized) -	    term_raw(); -	signal(SIGINT, prevtrap); -	return NULL; -    } -    if (fmInitialized) -	term_raw(); -    signal(SIGINT, prevtrap); - -    cache->loaded = IMG_FLAG_LOADED; -    getImageSize(cache); - -  image_buffer: -    tmp = Sprintf("<img src=\"%s\"><br><br>", html_quote(image->url)); -    if (newBuf == NULL) -	newBuf = newBuffer(INIT_BUFFER_WIDTH); -    if (frame_source) { -	tmpf = tmpfname(TMPF_SRC, ".html"); -	src = fopen(tmpf->ptr, "w"); -	newBuf->sourcefile = tmpf->ptr; -	pushText(fileToDelete, tmpf->ptr); -    } -    init_stream(&f, SCM_LOCAL, newStrStream(tmp)); -    loadHTMLstream(&f, newBuf, src, TRUE); -    if (src) -	fclose(src); - -    newBuf->topLine = newBuf->firstLine; -    newBuf->lastLine = newBuf->currentLine; -    newBuf->currentLine = newBuf->firstLine; -    return newBuf; -} -#endif -  /*    * saveBuffer: write buffer to file   */ @@ -6641,9 +6165,10 @@ save2tmp(URLFile uf, char *tmpf)      if (SETJMP(AbortLoading) != 0) {  	goto _end;      } -    prevtrap = signal(SIGINT, KeyAbort); -    if (fmInitialized) +    if (fmInitialized) { +	prevtrap = signal(SIGINT, KeyAbort);  	term_cbreak(); +    }      check = 0;      current_content_length = 0;  #ifdef USE_NNTP @@ -6679,9 +6204,10 @@ save2tmp(URLFile uf, char *tmpf)      }    _end:      bcopy(env_bak, AbortLoading, sizeof(JMP_BUF)); -    if (fmInitialized) +    if (fmInitialized) {  	term_raw(); -    signal(SIGINT, prevtrap); +	signal(SIGINT, prevtrap); +    }      fclose(ff);      if (uf.scheme == SCM_FTP)  	FTPhalfclose(uf.stream); @@ -1,4 +1,4 @@ -/* $Id: mktable.c,v 1.9 2002/02/01 13:58:47 inu Exp $ */ +/* $Id: mktable.c,v 1.8.2.1 2002/02/04 16:26:29 ukai Exp $ */  #include <stdio.h>  #include <stdlib.h>  #include <ctype.h> @@ -1,4 +1,4 @@ -/* $Id: url.c,v 1.41 2002/02/04 14:49:21 ukai Exp $ */ +/* $Id: url.c,v 1.39.2.1 2002/02/04 16:26:29 ukai Exp $ */  #include <stdio.h>  #include "config.h"  #include "fm.h" diff --git a/version.c.in b/version.c.in index ec1d748..fe41de8 100644 --- a/version.c.in +++ b/version.c.in @@ -1,5 +1,5 @@ -/* $Id: version.c.in,v 1.12 2002/01/31 15:54:20 ukai Exp $ */ -#define CURRENT_VERSION "w3m/0.2.5+cvs" +/* $Id: version.c.in,v 1.11.2.1 2002/02/04 16:26:29 ukai Exp $ */ +#define CURRENT_VERSION "w3m/0.2.5.1"  #ifndef FM_H  char *w3m_version = CURRENT_VERSION; | 
