From 0369c273f23b727b155180671933727d61e2035e Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Tue, 27 Nov 2001 18:23:33 +0000 Subject: [w3m-dev 02578] From: Fumitoshi UKAI --- ChangeLog | 13 +++++++++++++ conv.c | 8 +++----- file.c | 42 +++++++++++++++++++++++++++--------------- fm.h | 4 ++-- html.c | 7 ++++--- main.c | 11 ++++------- 6 files changed, 53 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc96602..b88dd1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2001-11-28 Fumitoshi UKAI + + * [w3m-dev 02578] + * file.c (process_anchor): support + * html.c (ALST_INPUT): add ATTR_SRC, ATTR_WIDTH, ATTR_HEIGHT + * html.c (MAXA_INPUT): +3 + + * conv.c (checkShiftCode): fix comments for indent(1) + * main.c (loadLink): ditto + * fm.h: ditto + * file.c (process_anchor); ditto + * file.c (HTMLlineproc2body): ditto + 2001-11-28 Hironori Sakamoto * [w3m-dev 02576] diff --git a/conv.c b/conv.c index 50c32a6..42144b0 100644 --- a/conv.c +++ b/conv.c @@ -1,4 +1,4 @@ -/* $Id: conv.c,v 1.4 2001/11/24 02:01:26 ukai Exp $ */ +/* $Id: conv.c,v 1.5 2001/11/27 18:23:33 ukai Exp $ */ #include #include #include "fm.h" @@ -565,8 +565,7 @@ checkShiftCode(Str buf, uchar hint) case EUC_NOSTATE: if (!(*p & 0x80)) /* ASCII */ ; - else if (0xa1 <= *p && *p <= 0xfe) /* JIS X 0208, - * * * * * 0213-1 */ + else if (0xa1 <= *p && *p <= 0xfe) /* JIS X 0208, 0213-1 */ euc = (CODE_STATE(euc) | EUC_MBYTE1); else if (*p == EUC_SS2_CODE) /* SS2 + JIS X 0201-Kana */ euc = (CODE_STATE(euc) | EUC_SS2); @@ -625,8 +624,7 @@ checkShiftCode(Str buf, uchar hint) case SJIS_SHIFT_H: if (CODE_STATE(sjis) == CODE_NORMAL) sjis = CODE_OK; - if ((0x40 <= *p && *p <= 0x7e) || (0x80 <= *p && *p <= 0xfc)) /* JIS X 0208, - * * * * * 0213 */ + if ((0x40 <= *p && *p <= 0x7e) || (0x80 <= *p && *p <= 0xfc)) /* JIS X 0208, 0213 */ sjis = (CODE_STATE(sjis) | SJIS_NOSTATE); else if (sjis & CODE_BROKEN) sjis = CODE_ERROR; diff --git a/file.c b/file.c index bd7d406..22011f9 100644 --- a/file.c +++ b/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.15 2001/11/25 17:41:57 ukai Exp $ */ +/* $Id: file.c,v 1.16 2001/11/27 18:23:33 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -2324,8 +2324,9 @@ process_anchor(struct parsed_tag *tag, char *tagbuf) Str process_input(struct parsed_tag *tag) { - int i, w, v, x, y, z; + int i, w, v, x, y, z, iw, ih; char *q, *p, *r, *p2; + char *pi = NULL; Str tmp; char *qq = ""; int qlen = 0; @@ -2360,10 +2361,11 @@ process_input(struct parsed_tag *tag) case FORM_INPUT_RESET: q = "RESET"; break; - /* if no VALUE attribute is specified in * tag, then the value "on" is used * as a - * default value. It is not a part of HTML4.0 * specification, - * but an imitation of Netscape * behaviour. */ + /* if no VALUE attribute is specified in + * tag, then the value "on" is used + * as a default value. It is not a part of HTML4.0 + * specification, but an imitation of Netscape behaviour. + */ case FORM_INPUT_CHECKBOX: q = "on"; } @@ -2434,20 +2436,31 @@ process_input(struct parsed_tag *tag) } break; case FORM_INPUT_IMAGE: + parsedtag_get_value(tag, ATTR_SRC, &pi); + if (pi) { + Strcat(tmp, Sprintf(""); + if (p2) + Strcat_charp(tmp, html_quote(p2)); + else + Strcat_charp(tmp, qq); + Strcat_charp(tmp, ""); + break; + } + /* FALL THROUGH */ case FORM_INPUT_SUBMIT: case FORM_INPUT_BUTTON: - if (p2) { + if (p2) Strcat_charp(tmp, html_quote(p2)); - i = strlen(p2); - } - else { + else Strcat_charp(tmp, qq); - i = qlen; - } break; case FORM_INPUT_RESET: Strcat_charp(tmp, qq); - i = qlen; break; case FORM_INPUT_RADIO: case FORM_INPUT_CHECKBOX: @@ -3963,8 +3976,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) /* nothing to do */ break; case HTML_AREA: - if (buf->maplist == NULL) /* outside of * - * * * * * .. */ + if (buf->maplist == NULL) /* outside of .. */ break; if (parsedtag_get_value(tag, ATTR_HREF, &p)) { p = remove_space(p); diff --git a/fm.h b/fm.h index 64d8e93..76fb73c 100644 --- a/fm.h +++ b/fm.h @@ -1,4 +1,4 @@ -/* $Id: fm.h,v 1.21 2001/11/26 09:01:08 ukai Exp $ */ +/* $Id: fm.h,v 1.22 2001/11/27 18:23:33 ukai Exp $ */ /* * w3m: WWW wo Miru utility * @@ -10,7 +10,7 @@ #ifndef FM_H #define FM_H -#define _GNU_SOURCE /* strcasestr() */ +#define _GNU_SOURCE /* strcasestr() */ #include #include diff --git a/html.c b/html.c index 4b7fad9..7b5253c 100644 --- a/html.c +++ b/html.c @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.5 2001/11/24 02:01:26 ukai Exp $ */ +/* $Id: html.c,v 1.6 2001/11/27 18:23:33 ukai Exp $ */ #include "html.h" /* Define HTML Tag Infomation Table */ @@ -43,9 +43,10 @@ unsigned char ALST_FORM[] = #define MAXA_FORM MAXA_CORE + 7 unsigned char ALST_INPUT[] = { ATTR_TYPE, ATTR_VALUE, ATTR_NAME, ATTR_CHECKED, ATTR_ACCEPT, ATTR_SIZE, - ATTR_MAXLENGTH, ATTR_ALT, ATTR_READONLY, ATTR_CORE + ATTR_MAXLENGTH, ATTR_ALT, ATTR_READONLY, ATTR_SRC, ATTR_WIDTH, ATTR_HEIGHT, + ATTR_CORE }; -#define MAXA_INPUT MAXA_CORE + 9 +#define MAXA_INPUT MAXA_CORE + 12 unsigned char ALST_TEXTAREA[] = { ATTR_COLS, ATTR_ROWS, ATTR_NAME, ATTR_READONLY, ATTR_CORE }; #define MAXA_TEXTAREA MAXA_CORE + 4 diff --git a/main.c b/main.c index c243939..1c47c51 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.24 2001/11/27 04:45:28 ukai Exp $ */ +/* $Id: main.c,v 1.25 2001/11/27 18:23:33 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include @@ -2362,12 +2362,9 @@ loadLink(char *url, char *target, char *referer, FormList *request) if (do_download) /* download (thus no need to render frame) */ return loadNormalBuf(buf, FALSE); - if (target == NULL || /* no target specified (that means * this - * page is not a frame page) */ - !strcmp(target, "_top") || /* this link is specified to * be - * opened as an indivisual * page */ - !(Currentbuf->bufferprop & BP_FRAME) /* This page is not a * - * * * * * frame page */ + if (target == NULL || /* no target specified (that means this page is not a frame page) */ + !strcmp(target, "_top") || /* this link is specified to be opened as an indivisual * page */ + !(Currentbuf->bufferprop & BP_FRAME) /* This page is not a frame page */ ) { return loadNormalBuf(buf, TRUE); } -- cgit v1.2.3