diff -urN w3m-0.1.10-pre+666/cookie.c w3m-0.1.10-pre+666-kokb/cookie.c
--- w3m-0.1.10-pre+666/cookie.c Fri May 26 17:03:13 2000
+++ w3m-0.1.10-pre+666-kokb/cookie.c Fri May 26 17:03:57 2000
@@ -238,7 +238,7 @@
struct portlist *portlist = NULL;
#ifdef DEBUG
- fprintf(stderr, "host: [%s, %s] %d\n", pu->host, pu->file, secure);
+ fprintf(stderr, "host: [%s, %s] %d\n", pu->host, pu->file, flag);
fprintf(stderr, "cookie: [%s=%s]\n", name->ptr, value->ptr);
fprintf(stderr, "expires: [%s]\n", asctime(gmtime(&expires)));
if (domain)
diff -urN w3m-0.1.10-pre+666/display.c w3m-0.1.10-pre+666-kokb/display.c
--- w3m-0.1.10-pre+666/display.c Fri May 26 17:03:13 2000
+++ w3m-0.1.10-pre+666-kokb/display.c Fri May 26 17:03:57 2000
@@ -618,13 +618,18 @@
else if (c != '\n')
addch(c);
#else
+ else if ((unsigned char) c == 0xa0) /* NO-BREAK SPACE */
+ addch(' ');
else if (c != '\n') {
if ((unsigned char) c < 0x80 || (unsigned char) c > 0x9F) {
addch(c);
}
+ else {
/* else: Eliminate unprintables according to
* iso-8859-*. Particularly 0x96 messes up T.Dickey's
* (xfree-)xterm */
+ addch(' ');
+ }
}
#endif
/* do nothing for \n */
diff -urN w3m-0.1.10-pre+666/file.c w3m-0.1.10-pre+666-kokb/file.c
--- w3m-0.1.10-pre+666/file.c Fri May 26 17:03:13 2000
+++ w3m-0.1.10-pre+666-kokb/file.c Fri May 26 17:03:58 2000
@@ -3847,9 +3847,6 @@
return 0;
}
-static char *tbl_srch_table[] =
-{"flag & RB_INTXTA) {
- p = strcasestr(str, "");
- if (p == NULL) {
- feed_textarea(str);
- return;
- }
- else {
- if (p != str) {
- q = allocStr(str, p - str);
- feed_textarea(q);
- }
- close_textarea(h_env);
- str = p + 11;
- }
- }
-
-#ifdef MENU_SELECT
- if (obuf->flag & RB_INSELECT) {
- p = strcasestr(str, "");
- if (p == NULL)
- /* fail safe */
- p = strcasestr(str, "");
-
- if (p == NULL) {
- feed_select(str);
- return;
- }
- else {
- if (p != str) {
- q = allocStr(str, p - str);
- feed_select(q);
- }
- obuf->flag &= ~RB_INSELECT;
- if (!strncasecmp(p, "", 7))
- process_n_select();
- str = p;
- }
- }
-#endif /* MENU_SELECT */
-
- /* script */
- if (obuf->flag & RB_IGNORE) {
- p = strcasestr(str, obuf->ignore_tag->ptr);
- if (p == NULL) {
- /* just ignore script */
- return;
- }
- obuf->flag &= ~RB_IGNORE;
- str = p + obuf->ignore_tag->length;
- }
-
/* comment processing */
if (obuf->status == R_ST_CMNT || obuf->status == R_ST_NCMNT3 ||
obuf->status == R_ST_IRRTAG) {
@@ -3944,27 +3889,70 @@
return;
}
- /*
.. : Don't process tag */
- if (obuf->flag & RB_XMPMODE) {
- p = strcasestr(str, "");
- if (p == NULL)
- goto read_as_plain;
- if (p != str) {
- q = allocStr(str, p - str);
- HTMLlineproc1(q, h_env);
- }
- str = p;
- }
- /* .. : ignore tag */
- if (obuf->flag & RB_LSTMODE) {
- p = strcasestr(str, "");
- if (p == NULL)
- goto read_as_plain;
- if (p != str) {
- q = allocStr(str, p - str);
- HTMLlineproc1(q, h_env);
+ if (obuf->flag & (RB_INTXTA
+#ifdef MENU_SELECT
+ |RB_INSELECT
+#endif
+ |RB_XMPMODE|RB_LSTMODE|RB_IGNORE)) {
+ Str tok = Strnew(), tmp;
+ if (obuf->status != R_ST_NORMAL && h_env->tagbuf->length > 0) {
+ tmp = Strdup(h_env->tagbuf);
+ Strcat_charp(tmp, str);
+ str = tmp->ptr;
+ obuf->status = R_ST_NORMAL;
+ }
+ while (read_token(tok, &str, &obuf->status, 0, 0)) {
+ char *p = tok->ptr;
+ int status, cmd = -1;
+ if (ST_IS_COMMENT(obuf->status))
+ goto beginning;
+ if (obuf->status != R_ST_NORMAL) {
+ h_env->tagbuf = tok;
+ return;
+ }
+ if (*p == '<')
+ cmd = gethtmlcmd(&p, &status);
+ /* textarea */
+ if (obuf->flag & RB_INTXTA) {
+ if (cmd == HTML_N_TEXTAREA) {
+ close_textarea(h_env);
+ break;
+ }
+ feed_textarea(tok->ptr);
+ }
+#ifdef MENU_SELECT
+ else if (obuf->flag & RB_INSELECT) {
+ if (cmd == HTML_N_SELECT || cmd == HTML_N_FORM) {
+ obuf->flag &= ~RB_INSELECT;
+ if (cmd == HTML_N_FORM)
+ str -= tok->length;
+ tmp = process_n_select();
+ if (tmp)
+ HTMLlineproc1(tmp->ptr, h_env);
+ break;
+ }
+ feed_select(tok->ptr);
+ }
+#endif
+ /* .. : Don't process tag */
+ /* .. : ignore tag */
+ else if (obuf->flag & (RB_XMPMODE|RB_LSTMODE)) {
+ if (obuf->flag & RB_XMPMODE && cmd == HTML_N_XMP ||
+ obuf->flag & RB_LSTMODE && cmd == HTML_N_LISTING) {
+ str -= tok->length;
+ break;
+ }
+ goto read_as_plain;
+ }
+ /* script */
+ else if (obuf->flag & RB_IGNORE) {
+ if (TAG_IS(tok->ptr, obuf->ignore_tag->ptr,
+ obuf->ignore_tag->length -1)) {
+ obuf->flag &= ~RB_IGNORE;
+ break;
+ }
+ }
}
- str = p;
}
while (*str != '\0') {
@@ -3974,89 +3962,49 @@
* are fed to the table renderer, and then the renderer
* makes HTML output.
*/
- check_table_tag:
- if (obuf->flag & RB_N_TABLE) {
- /* ``'' */
- while (*str) {
- if (*str == '>') {
- obuf->flag &= ~RB_N_TABLE;
- str++;
- goto table_end;
- }
- str++;
- }
+ check_table_tag:
+ if (*str == '\0')
return;
- }
-
- i = strcasemstr(str, tbl_srch_table, &p);
- if (i >= 0) {
- if (p != str) {
- q = allocStr(str, p - str);
- feed_table(tables[obuf->table_level - 1], q,
+ switch (feed_table(tables[obuf->table_level - 1], &str,
+ &table_mode[obuf->table_level - 1],
+ table_width[obuf->table_level - 1])) {
+ case 0:
+ /* tag */
+ obuf->table_level--;
+ obuf->prevchar = ' ';
+ if (obuf->table_level > 0) {
+ Str tmp;
+ if (table_width[obuf->table_level] > 0)
+ tmp = Sprintf("",
+ tables[obuf->table_level - 1]->ntable,
+ table_width[obuf->table_level]);
+ else
+ tmp = Sprintf("",
+ tables[obuf->table_level - 1]->ntable);
+ pushTable(tables[obuf->table_level - 1],
+ tables[obuf->table_level]);
+ feed_table1(tables[obuf->table_level - 1], tmp,
&table_mode[obuf->table_level - 1],
table_width[obuf->table_level - 1]);
- str = p;
- }
- switch (i) {
- case 0:
- /* tag */
- str += 7;
- while (*str && *str != '>')
- str++;
- if (*str != '>') {
- obuf->flag |= RB_N_TABLE;
- return;
- }
- str++;
- table_end:
- obuf->table_level--;
- obuf->prevchar = ' ';
- if (obuf->table_level > 0) {
- Str tmp;
- if (table_width[obuf->table_level] > 0)
- tmp = Sprintf("",
- tables[obuf->table_level - 1]->ntable,
- table_width[obuf->table_level]);
- else
- tmp = Sprintf("",
- tables[obuf->table_level - 1]->ntable);
- pushTable(tables[obuf->table_level - 1],
- tables[obuf->table_level]);
- feed_table(tables[obuf->table_level - 1], tmp->ptr,
- &table_mode[obuf->table_level - 1],
- table_width[obuf->table_level - 1]);
- goto check_table_tag;
- /* continue to the next */
- }
- if (obuf->table_level == 0) {
- save_fonteffect(h_env, obuf);
- renderTable(tables[0], table_width[0], h_env);
- restore_fonteffect(h_env, obuf);
- mode = PC_ASCII;
- }
- case 1:
- /* tag */
- goto proc_normal;
- case 2:
- /* comment */
- regexCompile("--[ \t\n\r]*>", 0);
- if (regexMatch(str, 0)) {
- matchedPosition(&p, &q);
- obuf->status = R_ST_NORMAL;
- str = q;
- }
- else {
- obuf->status = R_ST_CMNT;
- return;
- }
+ goto check_table_tag;
+ /* continue to the next */
}
- goto check_table_tag;
- }
- else {
- feed_table(tables[obuf->table_level - 1], str,
- &table_mode[obuf->table_level - 1],
- table_width[obuf->table_level - 1]);
+ if (obuf->table_level == 0) {
+ save_fonteffect(h_env, obuf);
+ renderTable(tables[0], table_width[0], h_env);
+ restore_fonteffect(h_env, obuf);
+ mode = PC_ASCII;
+ }
+ case 1:
+ /* tag */
+ goto proc_normal;
+ case 2:
+ /* comment */
+ obuf->status = tables[obuf->table_level - 1]->status;
+ tables[obuf->table_level - 1]->status = R_ST_NORMAL;
return;
+ default:
+ goto check_table_tag;
}
}
proc_normal:
@@ -4275,7 +4223,11 @@
}
}
}
- if (!(obuf->flag & (RB_PREMODE | RB_NOBR))) {
+ if (!(obuf->flag & (RB_PREMODE | RB_NOBR | RB_INTXTA
+#ifdef MENU_SELECT
+ | RB_INSELECT
+#endif
+ | RB_XMPMODE | RB_LSTMODE | RB_IGNORE))) {
char *tp;
int i = 0;
diff -urN w3m-0.1.10-pre+666/fm.h w3m-0.1.10-pre+666-kokb/fm.h
--- w3m-0.1.10-pre+666/fm.h Fri May 26 17:03:13 2000
+++ w3m-0.1.10-pre+666-kokb/fm.h Fri May 26 17:03:58 2000
@@ -383,7 +383,6 @@
#define RB_IGNORE_P 0x4000
#define RB_TITLE 0x8000
-#define RB_N_TABLE 0x100000
#ifdef FORMAT_NICE
#define RB_FILL 0x200000
#endif /* FORMAT_NICE */
diff -urN w3m-0.1.10-pre+666/proto.h w3m-0.1.10-pre+666-kokb/proto.h
--- w3m-0.1.10-pre+666/proto.h Fri May 26 17:03:13 2000
+++ w3m-0.1.10-pre+666-kokb/proto.h Fri May 26 17:03:58 2000
@@ -230,7 +230,8 @@
extern struct table *begin_table(int border, int spacing, int padding);
extern void check_rowcol(struct table *tbl);
extern int minimum_length(char *line);
-extern void feed_table(struct table *tbl, char *tline, struct table_mode *mode, int width);
+extern int feed_table(struct table *tbl, char **tline, struct table_mode *mode, int width);
+extern void feed_table1(struct table *tbl, Str tok, struct table_mode *mode, int width);
extern void pushTable(struct table *, struct table *);
extern struct form_list *newFormList(char *action, char *method, char *charset, char *enctype, char *target, struct form_list *_next);
extern struct form_item_list *formList_addInput(struct form_list *fl, struct parsed_tagarg *arg);
diff -urN w3m-0.1.10-pre+666/table.c w3m-0.1.10-pre+666-kokb/table.c
--- w3m-0.1.10-pre+666/table.c Fri May 26 17:03:13 2000
+++ w3m-0.1.10-pre+666-kokb/table.c Fri May 26 17:03:58 2000
@@ -1984,12 +1984,15 @@
#define TAG_ACTION_NONE 0
#define TAG_ACTION_FEED 1
+#define TAG_ACTION_TABLE 2
+#define TAG_ACTION_N_TABLE 3
static int
feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, int width)
{
int cmd;
char *s_line;
+ char *p;
struct table_cell *cell = &tbl->cell;
struct parsed_tagarg *t_arg,
*t;
@@ -2013,22 +2016,51 @@
s_line = line;
cmd = gethtmlcmd(&s_line, &status);
+ if (mode->pre_mode & TBLM_IGNORE) {
+ switch (cmd) {
+ case HTML_N_STYLE:
+ mode->pre_mode &= ~TBLM_STYLE;
+ case HTML_N_SCRIPT:
+ mode->pre_mode &= ~TBLM_SCRIPT;
+ default:
+ return TAG_ACTION_NONE;
+ }
+ }
+
#ifdef MENU_SELECT
/* failsafe: a tag other than and in
*