Common subdirectories: w3m/Bonus and w3m-0.1.10-pre+666/Bonus Common subdirectories: w3m/CVS and w3m-0.1.10-pre+666/CVS Common subdirectories: w3m/Patches and w3m-0.1.10-pre+666/Patches diff -c w3m/XXMakefile w3m-0.1.10-pre+666/XXMakefile *** w3m/XXMakefile Wed May 17 18:05:45 2000 --- w3m-0.1.10-pre+666/XXMakefile Tue May 23 20:09:04 2000 *************** *** 2,15 **** BIN_DIR = /usr/local/bin HELP_DIR = /usr/local/lib/w3m ! LIB_DIR = /usr/local/lib/w3m ! HELP_FILE = w3mhelp-w3m_ja.html ! SYS_LIBRARIES = -lgpm -lbsd -lnsl -lncurses -L/usr/local/ssl/lib -lssl -lcrypto LOCAL_LIBRARIES = CC = gcc ! MYCFLAGS = -O -I./gc -I/usr/local/ssl/include/openssl -I/usr/local/ssl/include ! KEYBIND_SRC = keybind.c ! KEYBIND_OBJ = keybind.o EXT= MATHLIB=-lm GCLIB=gc/gc.a --- 2,15 ---- BIN_DIR = /usr/local/bin HELP_DIR = /usr/local/lib/w3m ! LIB_DIR = /usr/local/libexec/w3m ! HELP_FILE = w3mhelp-lynx_ja.html ! SYS_LIBRARIES = -lncurses LOCAL_LIBRARIES = CC = gcc ! MYCFLAGS = -O -Wall -I./gc ! KEYBIND_SRC = keybind_lynx.c ! KEYBIND_OBJ = keybind_lynx.o EXT= MATHLIB=-lm GCLIB=gc/gc.a *************** *** 17,23 **** RANLIB=ranlib MKDIR=mkdir -p VERSION=0.1.10-pre ! MODEL=Linux.i686-monster-ja #else SRCS=main.c file.c buffer.c display.c etc.c search.c linein.c table.c local.c \ form.c map.c frame.c rc.c menu.c mailcap.c\ --- 17,23 ---- RANLIB=ranlib MKDIR=mkdir -p VERSION=0.1.10-pre ! MODEL=FreeBSD.i386-custom-ja #else SRCS=main.c file.c buffer.c display.c etc.c search.c linein.c table.c local.c \ form.c map.c frame.c rc.c menu.c mailcap.c\ diff -c w3m/anchor.c w3m-0.1.10-pre+666/anchor.c *** w3m/anchor.c Mon Apr 24 10:41:18 2000 --- w3m-0.1.10-pre+666/anchor.c Tue May 23 18:10:44 2000 *************** *** 51,58 **** a->url = url; a->target = target; a->referer = referer; ! a->start.line = line; ! a->start.pos = pos; al->nanchor++; if (anchor_return) *anchor_return = a; --- 51,58 ---- a->url = url; a->target = target; a->referer = referer; ! a->start = bp; ! a->end = bp; al->nanchor++; if (anchor_return) *anchor_return = a; diff -c w3m/buffer.c w3m-0.1.10-pre+666/buffer.c *** w3m/buffer.c Mon Apr 24 09:47:53 2000 --- w3m-0.1.10-pre+666/buffer.c Tue May 23 18:24:42 2000 *************** *** 95,101 **** } while (buf->frameset) { deleteFrameSet(buf->frameset); ! buf->frameset = popFrameTree(&(buf->frameQ)); } } --- 95,101 ---- } while (buf->frameset) { deleteFrameSet(buf->frameset); ! buf->frameset = popFrameTree(&(buf->frameQ), NULL, NULL); } } *************** *** 223,232 **** gotoLine(Buffer * buf, int n) { char msg[32]; ! Line *l = buf->firstLine; if (l == NULL) return; if (l->linenumber > n) { sprintf(msg, "First line is #%ld", l->linenumber); disp_message(msg, FALSE); --- 223,240 ---- gotoLine(Buffer * buf, int n) { char msg[32]; ! Line *l = buf->firstLine, *line_p; ! int linelen = 0; if (l == NULL) return; + if (buf->pagerSource && strcmp(buf->buffername, CPIPEBUFFERNAME)) { + while((buf->lastLine->linenumber < n) && + ((line_p = getNextPage(buf, 1)) != NULL)) { + linelen += line_p->len; + showProgress(&linelen, &(buf->trbyte)); + } + } if (l->linenumber > n) { sprintf(msg, "First line is #%ld", l->linenumber); disp_message(msg, FALSE); *************** *** 235,256 **** } if (buf->lastLine->linenumber < n) { l = buf->lastLine; ! sprintf(msg, "Last line is #%ld", l->linenumber); disp_message(msg, FALSE); buf->topLine = buf->currentLine = l; return; } for (; l != NULL; l = l->next) { ! if (l->linenumber == n) { buf->currentLine = l; if (n < buf->topLine->linenumber || buf->topLine->linenumber + LASTLINE + 1 <= n) ! buf->topLine = lineSkip(l, -(LASTLINE + 1) / 2); break; } } } static Buffer * listBuffer(Buffer * top, Buffer * current) --- 243,307 ---- } if (buf->lastLine->linenumber < n) { l = buf->lastLine; ! sprintf(msg, "Last line is #%ld", buf->lastLine->linenumber); disp_message(msg, FALSE); buf->topLine = buf->currentLine = l; return; } for (; l != NULL; l = l->next) { ! if (l->linenumber >= n) { buf->currentLine = l; if (n < buf->topLine->linenumber || buf->topLine->linenumber + LASTLINE + 1 <= n) ! buf->topLine = lineSkip(buf, l, -(LASTLINE + 1) / 2, FALSE); break; } } } + /* + * gotoRealLine: go to real line number + */ + void + gotoRealLine(Buffer * buf, int n) + { + char msg[32]; + Line *l = buf->firstLine, *line_p; + int linelen = 0; + + if (l == NULL) + return; + if (buf->pagerSource && strcmp(buf->buffername, CPIPEBUFFERNAME)) { + while((buf->lastLine->real_linenumber < n) && + ((line_p = getNextPage(buf, 1)) != NULL)) { + linelen += line_p->len; + showProgress(&linelen, &(buf->trbyte)); + } + } + if (l->real_linenumber > n) { + sprintf(msg, "First line is #%ld", l->real_linenumber); + disp_message(msg, FALSE); + buf->topLine = buf->currentLine = l; + return; + } + if (buf->lastLine->real_linenumber < n) { + l = buf->lastLine; + sprintf(msg, "Last line is #%ld", buf->lastLine->real_linenumber); + disp_message(msg, FALSE); + buf->topLine = buf->currentLine = l; + return; + } + for (; l != NULL; l = l->next) { + if (l->real_linenumber >= n) { + buf->currentLine = l; + if (n < buf->topLine->real_linenumber || + buf->topLine->real_linenumber + LASTLINE + 1 <= n) + buf->topLine = lineSkip(buf, l, -(LASTLINE + 1) / 2, FALSE); + break; + } + } + } + static Buffer * listBuffer(Buffer * top, Buffer * current) *************** *** 423,428 **** --- 474,480 ---- { URLFile f; int linenum; + AnchorList *formitem; if ((f.stream.f = fopen(buf->sourcefile, "r")) == NULL) return; *************** *** 439,448 **** clearBuffer(buf); while (buf->frameset) { deleteFrameSet(buf->frameset); ! buf->frameset = popFrameTree(&(buf->frameQ)); } buf->width = INIT_BUFFER_WIDTH; loadHTMLstream(&f, buf, NULL); buf->topLine = buf->firstLine; --- 491,506 ---- clearBuffer(buf); while (buf->frameset) { deleteFrameSet(buf->frameset); ! buf->frameset = popFrameTree(&(buf->frameQ), NULL, NULL); } + formitem = buf->formitem; + buf->href = NULL; + buf->name = NULL; + buf->img = NULL; + buf->formitem = NULL; buf->width = INIT_BUFFER_WIDTH; + loadHTMLstream(&f, buf, NULL); buf->topLine = buf->firstLine; *************** *** 451,456 **** --- 509,515 ---- buf->height = LASTLINE + 1; gotoLine(buf, linenum); arrangeCursor(buf); + formResetBuffer(buf, formitem); f.close(f.stream); } diff -c w3m/config.h w3m-0.1.10-pre+666/config.h *** w3m/config.h Wed May 17 18:05:40 2000 --- w3m-0.1.10-pre+666/config.h Tue May 23 20:09:02 2000 *************** *** 54,60 **** /* * Support NNTP */ ! #undef USE_NNTP /* * Enable id attribute --- 54,60 ---- /* * Support NNTP */ ! #define USE_NNTP /* * Enable id attribute *************** *** 71,84 **** BIN_DIR = /usr/local/bin HELP_DIR = /usr/local/lib/w3m ! LIB_DIR = /usr/local/lib/w3m ! HELP_FILE = w3mhelp-w3m_ja.html ! SYS_LIBRARIES = -lgpm -lbsd -lnsl -lncurses -L/usr/local/ssl/lib -lssl -lcrypto LOCAL_LIBRARIES = CC = gcc ! MYCFLAGS = -O -I./gc -I/usr/local/ssl/include/openssl -I/usr/local/ssl/include ! KEYBIND_SRC = keybind.c ! KEYBIND_OBJ = keybind.o EXT= MATHLIB=-lm GCLIB=gc/gc.a --- 71,84 ---- BIN_DIR = /usr/local/bin HELP_DIR = /usr/local/lib/w3m ! LIB_DIR = /usr/local/libexec/w3m ! HELP_FILE = w3mhelp-lynx_ja.html ! SYS_LIBRARIES = -lncurses LOCAL_LIBRARIES = CC = gcc ! MYCFLAGS = -O -Wall -I./gc ! KEYBIND_SRC = keybind_lynx.c ! KEYBIND_OBJ = keybind_lynx.o EXT= MATHLIB=-lm GCLIB=gc/gc.a *************** *** 86,92 **** RANLIB=ranlib MKDIR=mkdir -p VERSION=0.1.10-pre ! MODEL=Linux.i686-monster-ja #else --- 86,92 ---- RANLIB=ranlib MKDIR=mkdir -p VERSION=0.1.10-pre ! MODEL=FreeBSD.i386-custom-ja #else *************** *** 98,117 **** #define KANJI_SYMBOLS #define COLOR #define MOUSE ! #define USE_GPM ! #undef USE_SYSMOUSE #define MENU #define USE_COOKIE ! #define USE_SSL #undef USE_SSL_VERIFY ! #undef FTPPASS_HOSTNAMEGEN ! #undef SHOW_PARAMS ! #define DEF_EDITOR "/bin/vi" ! #define DEF_MAILER "/bin/mail" ! #define DEF_EXT_BROWSER "/usr/X11R6/bin/netscape" ! #define LIB_DIR "/usr/local/lib/w3m" #define HELP_DIR "/usr/local/lib/w3m" #define HELP_FILE "w3mhelp.html" #define W3MCONFIG "w3mconfig" --- 98,117 ---- #define KANJI_SYMBOLS #define COLOR #define MOUSE ! ! #define USE_SYSMOUSE #define MENU #define USE_COOKIE ! #undef USE_SSL #undef USE_SSL_VERIFY ! #define FTPPASS_HOSTNAMEGEN ! #define SHOW_PARAMS ! #define DEF_EDITOR "/usr/local/bin/jvim" ! #define DEF_MAILER "/usr/bin/mail" ! #define DEF_EXT_BROWSER "/usr/local/bin/lynx" ! #define LIB_DIR "/usr/local/libexec/w3m" #define HELP_DIR "/usr/local/lib/w3m" #define HELP_FILE "w3mhelp.html" #define W3MCONFIG "w3mconfig" diff -c w3m/configure w3m-0.1.10-pre+666/configure *** w3m/configure Tue May 16 16:46:21 2000 --- w3m-0.1.10-pre+666/configure Tue May 23 18:10:44 2000 *************** *** 658,664 **** readanswer cc "$dcc" echo "dcc='$cc'" >> config.param ! if [ -z "$dcflags" ] ; then dcflags=-O ; fi echo "Input your favorite C flags." Echo "(Default: $dcflags) " readanswer cflags "$dcflags" --- 658,664 ---- readanswer cc "$dcc" echo "dcc='$cc'" >> config.param ! if [ -z "$dcflags" ] ; then dcflags="-O -Wall" ; fi echo "Input your favorite C flags." Echo "(Default: $dcflags) " readanswer cflags "$dcflags" diff -c w3m/conv.c w3m-0.1.10-pre+666/conv.c *** w3m/conv.c Tue May 16 16:53:38 2000 --- w3m-0.1.10-pre+666/conv.c Tue May 23 18:06:39 2000 *************** *** 28,49 **** #define USIcode "\033$" #define USOcode "\033+" ! char *SIcode, *SOcode; ! uchar *cOption; - int euc = false; - - Str conv(char *is, char fc, char tc); - void n_impr(char s); - void putSFT(unsigned char **pptr, unsigned char *code); - unsigned char getSLb(unsigned char *ptr, unsigned char *ub); Str cConvSE(unsigned char *is); Str cConvSJ(unsigned char *is); Str cConvJS(char *is); Str cConvEE(char *is); Str cConvES(char *is); - void put_js(unsigned char ub, unsigned char lb, Str op); char checkShiftCode(char *buf, char); static char *han2zen_tab[] = --- 28,42 ---- #define USIcode "\033$" #define USOcode "\033+" ! static char *SIcode, *SOcode; ! static uchar *cOption; Str cConvSE(unsigned char *is); Str cConvSJ(unsigned char *is); Str cConvJS(char *is); Str cConvEE(char *is); Str cConvES(char *is); char checkShiftCode(char *buf, char); static char *han2zen_tab[] = *************** *** 65,71 **** *ShiftOut; } ConvRoutine; ! ConvRoutine FromSJ[] = { {'J', cConvSJ, JSIcode, JSOcode}, {'N', cConvSJ, NSIcode, NSOcode}, --- 58,64 ---- *ShiftOut; } ConvRoutine; ! static ConvRoutine FromSJ[] = { {'J', cConvSJ, JSIcode, JSOcode}, {'N', cConvSJ, NSIcode, NSOcode}, *************** *** 76,82 **** {'E', cConvSE, "", ""} }; ! ConvRoutine ToSJ[] = { {'J', cConvJS, JSIcode, JSOcode}, {'N', cConvJS, NSIcode, NSOcode}, --- 69,75 ---- {'E', cConvSE, "", ""} }; ! static ConvRoutine ToSJ[] = { {'J', cConvJS, JSIcode, JSOcode}, {'N', cConvJS, NSIcode, NSOcode}, *************** *** 107,112 **** --- 100,112 ---- return ""; } + static void + n_impr(char s) + { + fprintf(stderr, "conv: option %c(0x%02x) is not implemented yet... sorry\n", s, s); + exit(1); + } + Str conv(char *is, char fc, char tc) { *************** *** 147,167 **** return os; } ! void ! n_impr(char s) ! { ! fprintf(stderr, "conv: option %c(0x%02x) is not implemented yet... sorry\n", s, s); ! exit(1); ! } ! ! void putSFT(unsigned char **pptr, unsigned char *code) { /* Put Shift in/out code */ while (*code != '\0') *((*pptr)++) = *(code++); } ! uchar getSLb(unsigned char *ptr, unsigned char *ub) { /* Get Shift-JIS Lower byte */ uchar c = *ptr; --- 147,160 ---- return os; } ! static void putSFT(unsigned char **pptr, unsigned char *code) { /* Put Shift in/out code */ while (*code != '\0') *((*pptr)++) = *(code++); } ! static uchar getSLb(unsigned char *ptr, unsigned char *ub) { /* Get Shift-JIS Lower byte */ uchar c = *ptr; *************** *** 180,187 **** } /* Convert Shift-JIS to JIS/real JIS/EUC */ ! static Str ! _cConvSJ(unsigned char *is) { Str os = Strnew_size(strlen(is) * 3 / 2); uchar c, --- 173,180 ---- } /* Convert Shift-JIS to JIS/real JIS/EUC */ ! static Str ! _cConvSJ(unsigned char *is, int euc) { Str os = Strnew_size(strlen(is) * 3 / 2); uchar c, *************** *** 250,267 **** Str cConvSE(unsigned char *is) { ! euc = true; ! return _cConvSJ(is); } Str cConvSJ(unsigned char *is) { ! euc = false; ! return _cConvSJ(is); } ! void put_js(unsigned char ub, unsigned char lb, Str op) { ub -= 0x20; --- 243,258 ---- Str cConvSE(unsigned char *is) { ! return _cConvSJ(is, true); } Str cConvSJ(unsigned char *is) { ! return _cConvSJ(is, false); } ! static void put_js(unsigned char ub, unsigned char lb, Str op) { ub -= 0x20; *************** *** 346,353 **** uchar ub; Str op = Strnew_size(strlen(is)); ! while (*ip != '\0') { ! ub = (uchar) * (ip++); if (ub == 0x8e && (uchar) * ip >= 0xa0 && (uchar) * ip <= 0xdf) { ub = (uchar) * (ip++); Strcat_char(op, han2zen_tab[ub - 0xa0][0] | 0x80); --- 337,345 ---- uchar ub; Str op = Strnew_size(strlen(is)); ! ub = (uchar) *ip; ! ip++; ! while (ub != '\0') { if (ub == 0x8e && (uchar) * ip >= 0xa0 && (uchar) * ip <= 0xdf) { ub = (uchar) * (ip++); Strcat_char(op, han2zen_tab[ub - 0xa0][0] | 0x80); *************** *** 356,361 **** --- 348,355 ---- else { Strcat_char(op, (char) ub); } + ub = (uchar) *ip; + ip++; } return op; } *************** *** 386,399 **** return op; } - #define EUC_ERROR 0 - #define EUC_NOSTATE 1 - #define EUC_REQ1 2 - #define EUC_REQ2 3 - #define SJIS_ERROR 0 - #define SJIS_NOSTATE 1 - #define SJIS_SHIFT 2 - static unsigned short sjis_shift[8] = { 0x7fff, 0xffff, 0x0, 0x0, 0x0, 0x0, 0xffff, 0x0 }; static unsigned short --- 380,385 ---- *************** *** 406,415 **** register unsigned char *p, c; unsigned char si = '\0', ! so = '\0'; ! char euc, ! sjis, ! euc_or_sjis; euc = EUC_NOSTATE; sjis = SJIS_NOSTATE; --- 392,409 ---- register unsigned char *p, c; unsigned char si = '\0', ! so = '\0'; ! char euc, /* euc parse state */ ! #define EUC_ERROR 0 ! #define EUC_NOSTATE 1 ! #define EUC_REQ1 2 ! #define EUC_REQ2 3 ! sjis, /* sjis parse state */ ! #define SJIS_ERROR 0 ! #define SJIS_NOSTATE 1 ! #define SJIS_SHIFT 2 ! euc_or_sjis; /* 0x01: CS uses right half (&0x80 == 0x80). ! 0x02: found right half ctrl char */ euc = EUC_NOSTATE; sjis = SJIS_NOSTATE; *************** *** 419,431 **** while (!((si && so) || (euc_or_sjis && (!euc || !sjis)) || (c = *p) == '\0')) { switch (c) { case '\033': switch (*(p + 1)) { case '$': /* Shift-in */ si = *(p + 2); break; ! case '(': /* Shift-out ) */ so = *(p + 2); break; default: --- 413,426 ---- while (!((si && so) || (euc_or_sjis && (!euc || !sjis)) || (c = *p) == '\0')) { + /* check JIS shift code */ switch (c) { case '\033': switch (*(p + 1)) { case '$': /* Shift-in */ si = *(p + 2); break; ! case '(': /* Shift-out ')' */ so = *(p + 2); break; default: *************** *** 433,438 **** --- 428,434 ---- } break; } + /* transition EUC state */ if ((unsigned char) 0xa1 <= c && c <= (unsigned char) 0xff) { switch (euc) { case EUC_NOSTATE: *************** *** 460,471 **** break; default: euc_or_sjis |= 2; ! } ! } } else { euc = EUC_ERROR; } } switch (sjis) { case SJIS_NOSTATE: if (c & 0x80 && --- 456,468 ---- break; default: euc_or_sjis |= 2; ! } ! } } else { euc = EUC_ERROR; } } + /* transition SJIS state */ switch (sjis) { case SJIS_NOSTATE: if (c & 0x80 && diff -c w3m/display.c w3m-0.1.10-pre+666/display.c *** w3m/display.c Wed May 17 18:04:18 2000 --- w3m-0.1.10-pre+666/display.c Tue May 23 18:24:42 2000 *************** *** 126,132 **** { Buffer *buf; char *f; ! while (Firstbuf) { buf = Firstbuf->nextBuffer; discardBuffer(Firstbuf); Firstbuf = buf; --- 126,132 ---- { Buffer *buf; char *f; ! while (Firstbuf && Firstbuf != NO_BUFFER) { buf = Firstbuf->nextBuffer; discardBuffer(Firstbuf); Firstbuf = buf; *************** *** 172,189 **** static int graph_mode = 0; #endif /* not KANJI_SYMBOLS */ void displayBuffer(Buffer * buf, int mode) { Str msg = Strnew(); Anchor *aa; #ifdef CLEAR_BUF if (buf->sourcefile != NULL && buf->topLine == NULL) { reloadBuffer(buf); gotoLine(buf,buf->currentLineNum); arrangeCursor(buf); ! } mode = B_FORCE_REDRAW; #endif if (buf->width == 0) --- 172,201 ---- static int graph_mode = 0; #endif /* not KANJI_SYMBOLS */ + #ifdef BUFINFO + static Buffer *save_current_buf = NULL; + #endif + + #ifdef BUFINFO + static Buffer *save_current_buf = NULL; + #endif + void displayBuffer(Buffer * buf, int mode) { Str msg = Strnew(); Anchor *aa; #ifdef CLEAR_BUF + AnchorList *formitem; + if (buf->sourcefile != NULL && buf->topLine == NULL) { + formitem = buf->formitem; reloadBuffer(buf); gotoLine(buf,buf->currentLineNum); arrangeCursor(buf); ! formResetBuffer(buf, formitem); mode = B_FORCE_REDRAW; + } #endif if (buf->width == 0) *************** *** 675,681 **** if (buf->cursorY > 0) cursorUpDown(buf, -1); else { ! buf->topLine = lineSkip(buf->topLine, -(LASTLINE + 1) / 2); if (buf->currentLine->prev != NULL) buf->currentLine = buf->currentLine->prev; buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; --- 687,693 ---- if (buf->cursorY > 0) cursorUpDown(buf, -1); else { ! buf->topLine = lineSkip(buf, buf->topLine, -(LASTLINE + 1) / 2, FALSE); if (buf->currentLine->prev != NULL) buf->currentLine = buf->currentLine->prev; buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; *************** *** 690,696 **** if (buf->cursorY < LASTLINE - 1) cursorUpDown(buf, 1); else { ! buf->topLine = lineSkip(buf->topLine, (LASTLINE + 1) / 2); if (buf->currentLine->next != NULL) buf->currentLine = buf->currentLine->next; buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; --- 702,708 ---- if (buf->cursorY < LASTLINE - 1) cursorUpDown(buf, 1); else { ! buf->topLine = lineSkip(buf, buf->topLine, (LASTLINE + 1) / 2, FALSE); if (buf->currentLine->next != NULL) buf->currentLine = buf->currentLine->next; buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; *************** *** 706,712 **** if (buf->firstLine == NULL) return; ! if ((buf->currentLine = lineSkip(cl, n)) == cl) return; buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; i = columnPos(buf->currentLine, buf->currentColumn + buf->visualpos); --- 718,724 ---- if (buf->firstLine == NULL) return; ! if ((buf->currentLine = lineSkip(buf, cl, n, FALSE)) == cl) return; buf->cursorY = buf->currentLine->linenumber - buf->topLine->linenumber; i = columnPos(buf->currentLine, buf->currentColumn + buf->visualpos); Common subdirectories: w3m/doc and w3m-0.1.10-pre+666/doc Common subdirectories: w3m/doc-jp and w3m-0.1.10-pre+666/doc-jp diff -c w3m/etc.c w3m-0.1.10-pre+666/etc.c *** w3m/etc.c Wed May 17 18:04:18 2000 --- w3m-0.1.10-pre+666/etc.c Tue May 23 18:00:42 2000 *************** *** 133,142 **** } Line * ! lineSkip(Line * line, int offset) { ! int i; ! Line *l = line; if (offset == 0) return l; --- 133,152 ---- } Line * ! lineSkip(Buffer * buf, Line * line, int offset, int last) { ! int i, n; ! Line *l = line, *line_p; ! int linelen = 0; ! ! if (buf->pagerSource && strcmp(buf->buffername, CPIPEBUFFERNAME)) { ! n = line->linenumber + offset + LASTLINE; ! while((last || (buf->lastLine->linenumber < n)) && ! ((line_p = getNextPage(buf, 1)) != NULL)) { ! linelen += line_p->len; ! showProgress(&linelen, &(buf->trbyte)); ! } ! } if (offset == 0) return l; diff -c w3m/file.c w3m-0.1.10-pre+666/file.c *** w3m/file.c Wed May 17 18:04:19 2000 --- w3m-0.1.10-pre+666/file.c Tue May 23 18:25:11 2000 *************** *** 28,68 **** static FILE *gunzip_stream(FILE * infp, int compressor); static FILE *lessopen_stream(char *path); ! static void close_textarea(struct html_feed_environ *h_env); ! static void addnewline(Buffer * buf, char *line, Lineprop * prop, int pos); static Lineprop propBuffer[LINELEN]; ! static JMP_BUF AbortLoading; static struct table *tables[MAX_TABLE]; ! static int table_width[MAX_TABLE]; static struct table_mode table_mode[MAX_TABLE]; #ifdef MENU_SELECT /* menu based */ FormSelectOption select_option[MAX_SELECT]; ! static Str cur_option; ! static Str cur_option_value; ! static int cur_option_selected; ! static int just_after_select; ! static int cur_option_maxwidth; ! static int cur_status = R_ST_NORMAL; ! static int n_select; #endif /* MENU_SELECT */ ! static Str cur_select; ! static int n_selectitem; ! static Str cur_textarea; ! Str textarea_str[MAX_TEXTAREA]; ! static int cur_textarea_size; ! static int cur_textarea_rows; ! static int n_textarea; ! static int select_is_multiple; ! static Str proxy_auth_cookie = NULL; ! static int http_response_code; ! ! static Str save_line = NULL; ! static char save_prevchar = ' '; #define FORMSTACK_SIZE 10 #define FRAMESTACK_SIZE 10 *************** *** 129,135 **** currentLn(Buffer * buf) { if (buf->currentLine) ! return buf->currentLine->linenumber + 1; else return 1; } --- 132,138 ---- currentLn(Buffer * buf) { if (buf->currentLine) ! return buf->currentLine->real_linenumber + 1; else return 1; } *************** *** 388,394 **** for (p = lineBuf2->ptr; *p; p = q) { for (q = p; *q && *q != '\r' && *q != '\n'; q++); lineBuf2 = checkType(p, propBuffer, min(LINELEN, q - p)); ! addnewline(newBuf, p, propBuffer, q - p); for (; *q && (*q == '\r' || *q == '\n'); q++); } } --- 391,397 ---- for (p = lineBuf2->ptr; *p; p = q) { for (q = p; *q && *q != '\r' && *q != '\n'; q++); lineBuf2 = checkType(p, propBuffer, min(LINELEN, q - p)); ! addnewline(newBuf, p, propBuffer, q - p, -1); for (; *q && (*q == '\r' || *q == '\n'); q++); } } *************** *** 564,570 **** lineBuf2 = NULL; } if (thru) ! addnewline(newBuf, "\n", propBuffer, 1); } char * --- 567,573 ---- lineBuf2 = NULL; } if (thru) ! addnewline(newBuf, "\n", propBuffer, 1, -1); } char * *************** *** 1177,1183 **** switch (ch) { case ',': case '.': ! case '\"': case '\'': case '$': case '%': --- 1180,1186 ---- switch (ch) { case ',': case '.': ! case '\"': /* " */ case '\'': case '$': case '%': *************** *** 1590,1595 **** --- 1593,1606 ---- flushline(h_env, obuf, indent, 1, width); } + void + fillline(struct html_feed_environ *h_env, struct readbuffer *obuf, int indent) + { + int i; + for (i = obuf->pos; i < indent; i++) + PUSH(' '); + } + static int close_effect0(struct readbuffer *obuf, char *tag, int taglen, int cmd) { *************** *** 1640,1654 **** } } - #define CLOSE_ANCHOR {\ - close_anchor0(h_env, obuf);\ - if (obuf->anchor) { \ - push_tag(obuf, "", HTML_N_A);\ - obuf->anchor = NULL; \ - }\ - obuf->anchor_target = NULL;\ - } - void save_fonteffect(struct html_feed_environ *h_env, struct readbuffer *obuf) { --- 1651,1656 ---- *************** *** 2249,2262 **** feed_textarea(char *str) { if (n_textarea < MAX_TEXTAREA) { - if (textarea_str[n_textarea]->length > 0 && - Strlastchar(textarea_str[n_textarea]) != '\n') - Strcat_char(textarea_str[n_textarea], '\n'); while (*str) { if (*str == '&') Strcat_charp(textarea_str[n_textarea], getescapecmd(&str)); ! else ! Strcat_char(textarea_str[n_textarea], *(str++)); } } } --- 2251,2265 ---- feed_textarea(char *str) { if (n_textarea < MAX_TEXTAREA) { while (*str) { if (*str == '&') Strcat_charp(textarea_str[n_textarea], getescapecmd(&str)); ! else if (*str == '\n' || *str == '\r') { ! Strcat_charp(textarea_str[n_textarea], "\r\n"); ! if (*(str++) == '\r' && *str == '\n') ! str++; ! } else ! Strcat_char(textarea_str[n_textarea], *(str++)); } } } *************** *** 2318,2337 **** static void clear_ignore_p_flag(int cmd, struct readbuffer *obuf) { ! static int ignore_p_cmd[] = { - HTML_LI, HTML_N_UL, HTML_N_OL, HTML_N_DL, HTML_N_BLQ, - HTML_DT, HTML_DD, HTML_N_H, HTML_BODY, HTML_PRE, - HTML_DIV, HTML_P, HTML_DL, HTML_UNKNOWN }; int i; ! for (i = 0; ignore_p_cmd[i] != HTML_UNKNOWN; i++) { ! if (cmd == ignore_p_cmd[i]) return; } - obuf->flag &= ~RB_IGNORE_P; } static void --- 2321,2338 ---- static void clear_ignore_p_flag(int cmd, struct readbuffer *obuf) { ! static int clear_flag_cmd[] = { HTML_UNKNOWN }; int i; ! for (i = 0; clear_flag_cmd[i] != HTML_UNKNOWN; i++) { ! if (cmd == clear_flag_cmd[i]) { ! obuf->flag &= ~RB_IGNORE_P; return; + } } } static void *************** *** 2367,2383 **** return; for (; t; t = t->next) { - if (!strcasecmp(t->arg, "name") && (cmd == HTML_A)) - return; if (!strcasecmp(t->arg, "id")) ! id = Sprintf("", t->value); } if (id == NULL) return; ! push_tag(obuf, id->ptr, HTML_A); } #endif /* ID_EXT */ #define CLOSE_P if (obuf->flag & RB_P) { \ flushline(h_env, obuf, envs[h_env->envc].indent,0,h_env->limit);\ RB_RESTORE_FLAG(obuf);\ --- 2368,2392 ---- return; for (; t; t = t->next) { if (!strcasecmp(t->arg, "id")) ! id = Sprintf("<_id id=\"%s\">", t->value); } if (id == NULL) return; ! push_tag(obuf, id->ptr, HTML_NOP); } #endif /* ID_EXT */ + #define CLOSE_ANCHOR { \ + close_anchor0(h_env, obuf); \ + if (obuf->anchor) { \ + push_tag(obuf, "", HTML_N_A); \ + hseq = 0; \ + obuf->anchor = NULL; \ + } \ + obuf->anchor_target = NULL; \ + } + #define CLOSE_P if (obuf->flag & RB_P) { \ flushline(h_env, obuf, envs[h_env->envc].indent,0,h_env->limit);\ RB_RESTORE_FLAG(obuf);\ *************** *** 2428,2453 **** HTMLtagproc1(int cmd, struct html_feed_environ *h_env) #endif /* ID_EXT */ { ! char *p, ! *q, ! *r; ! int i, ! w, ! x, ! y, ! type, ! count; #ifdef ID_EXT struct parsed_tagarg *t; #else struct parsed_tagarg *targ, *t; #endif /* ID_EXT */ ! struct readbuffer *obuf = h_env->obuf; ! struct environment *envs = h_env->envs; ! Str tmp = Strnew(); ! int hseq; #ifdef TABLE_EXPAND ! int ppc = PIXEL_PER_CHAR; #endif /* TABLE_EXPAND */ #ifdef ID_EXT Str id = NULL; --- 2437,2462 ---- HTMLtagproc1(int cmd, struct html_feed_environ *h_env) #endif /* ID_EXT */ { ! char *p, ! *q, ! *r; ! int i, ! w, ! x, ! y, ! type, ! count; #ifdef ID_EXT struct parsed_tagarg *t; #else struct parsed_tagarg *targ, *t; #endif /* ID_EXT */ ! struct readbuffer *obuf = h_env->obuf; ! struct environment *envs = h_env->envs; ! Str tmp = Strnew(); ! int hseq; #ifdef TABLE_EXPAND ! int ppc = PIXEL_PER_CHAR; #endif /* TABLE_EXPAND */ #ifdef ID_EXT Str id = NULL; *************** *** 2726,2739 **** obuf->flag |= RB_IGNORE_P; return 1; case HTML_TITLE: ! flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); ! /* discardline(obuf, envs[h_env->envc].indent); */ ! obuf->flag |= RB_NOBR; return 1; case HTML_N_TITLE: ! obuf->flag &= ~RB_NOBR; h_env->title = allocStr(obuf->line->ptr, 0); ! discardline(obuf, envs[h_env->envc].indent); Strcat_charp(tmp, "title)); Strcat_charp(tmp, "\">"); --- 2735,2758 ---- obuf->flag |= RB_IGNORE_P; return 1; case HTML_TITLE: ! append_tags(obuf); ! save_line = obuf->line; ! save_prevchar = obuf->prevchar; ! set_breakpoint(obuf, 0); ! obuf->line = Strnew(); ! discardline(obuf, 0); ! obuf->flag |= (RB_NOBR|RB_TITLE); return 1; case HTML_N_TITLE: ! if (!(obuf->flag & RB_TITLE)) ! return 1; ! obuf->flag &= ~(RB_NOBR|RB_TITLE); ! append_tags(obuf); h_env->title = allocStr(obuf->line->ptr, 0); ! obuf->line = save_line; ! obuf->prevchar = save_prevchar; ! obuf->pos = obuf->bp.pos; ! back_to_breakpoint(obuf); Strcat_charp(tmp, "title)); Strcat_charp(tmp, "\">"); *************** *** 2796,2805 **** w = h_env->limit; } } ! /* ! * else if (!strcasecmp(t->arg,"size") && t->value) { w = ! * atoi(t->value)/PIXEL_PER_CHAR; if (w > h_env->limit) { w = ! * h_env->limit; } } */ else if (!strcasecmp(t->arg, "align") && t->value) { p = t->value; } --- 2815,2828 ---- w = h_env->limit; } } ! /* ! else if (!strcasecmp(t->arg,"size") && t->value) { ! w = atoi(t->value)/PIXEL_PER_CHAR; ! if (w > h_env->limit) { ! w = h_env->limit; ! } ! } ! */ else if (!strcasecmp(t->arg, "align") && t->value) { p = t->value; } *************** *** 2841,2847 **** } if (i == 0) CLOSE_P; ! flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); obuf->flag |= (RB_PRE | RB_IGNORE_P); /* istr = str; */ return 1; --- 2864,2873 ---- } if (i == 0) CLOSE_P; ! if (!(obuf->flag & RB_IGNORE_P)) ! flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); ! else ! fillline(h_env, obuf, envs[h_env->envc].indent); obuf->flag |= (RB_PRE | RB_IGNORE_P); /* istr = str; */ return 1; *************** *** 2921,2928 **** #ifndef ID_EXT targ = parse_tag(h_env->tagbuf->ptr); #endif /* !ID_EXT */ ! hseq = 0; obuf->anchor = NULL; for (t = targ; t; t = t->next) { if (strcasecmp(t->arg, "href") == 0 && t->value) { --- 2947,2957 ---- #ifndef ID_EXT targ = parse_tag(h_env->tagbuf->ptr); #endif /* !ID_EXT */ ! if (obuf->anchor) { ! CLOSE_ANCHOR ! } obuf->anchor = NULL; + hseq = 0; for (t = targ; t; t = t->next) { if (strcasecmp(t->arg, "href") == 0 && t->value) { *************** *** 2946,2952 **** return 0; case HTML_N_A: CLOSE_ANCHOR ! return 1; case HTML_IMG: tmp = process_img(parse_tag(h_env->tagbuf->ptr)); HTMLlineproc1(tmp->ptr, h_env); --- 2975,2981 ---- return 0; case HTML_N_A: CLOSE_ANCHOR ! return 1; case HTML_IMG: tmp = process_img(parse_tag(h_env->tagbuf->ptr)); HTMLlineproc1(tmp->ptr, h_env); *************** *** 3056,3062 **** tables[obuf->table_level] = begin_table(w, x, y); #ifdef ID_EXT if (id != NULL) ! Strcopy(tables[obuf->table_level]->id, id); #endif /* ID_EXT */ #ifdef TABLE_EXPAND if (obuf->table_level == 0) --- 3085,3091 ---- tables[obuf->table_level] = begin_table(w, x, y); #ifdef ID_EXT if (id != NULL) ! tables[obuf->table_level]->id = Strdup(id); #endif /* ID_EXT */ #ifdef TABLE_EXPAND if (obuf->table_level == 0) *************** *** 3081,3087 **** return 1; case HTML_CENTER: CLOSE_P; ! if (!(obuf->flag & RB_PREMODE)) flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); RB_SAVE_FLAG(obuf); RB_SET_ALIGN(obuf, RB_CENTER); --- 3110,3116 ---- return 1; case HTML_CENTER: CLOSE_P; ! if (!(obuf->flag & (RB_PREMODE|RB_IGNORE_P))) flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); RB_SAVE_FLAG(obuf); RB_SET_ALIGN(obuf, RB_CENTER); *************** *** 3177,3213 **** q = t->value; } if (p && q && !strcasecmp(p, "refresh")) { ! int refresh; ! Str s_tmp = Strnew(); ! r = q; ! while (*r && *r != ';') ! Strcat_char(s_tmp, *(r++)); ! refresh = atoi(s_tmp->ptr); ! if (*r) ! r++; ! while (IS_SPACE(*r)) ! r++; ! s_tmp = Strnew(); ! if (!strncasecmp(r, "url=", 4)) { ! r += 4; ! while (*r && !IS_SPACE(*r)) ! Strcat_char(s_tmp, *(r++)); ! } ! tmp = Sprintf("Refresh (%d sec) %s", ! refresh, cur_hseq++, s_tmp->ptr, s_tmp->ptr); ! push_str(obuf, s_tmp->length, tmp, PC_ASCII); ! flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); ! #ifdef CLEAR_BUF ! if (refresh == 0 && !is_redisplay) { ! pushEvent(FUNCNAME_goURL, s_tmp->ptr); ! /* pushEvent(deletePrevBuf,NULL); */ ! } ! #else /* not CLEAR_BUF */ ! if (refresh == 0) { ! pushEvent(FUNCNAME_goURL, s_tmp->ptr); ! /* pushEvent(deletePrevBuf,NULL); */ } - #endif /* not CLEAR_BUF */ } return 1; case HTML_BASE: --- 3206,3250 ---- q = t->value; } if (p && q && !strcasecmp(p, "refresh")) { ! int refresh = atoi(q); ! Str s_tmp = NULL; ! ! while (*q) { ! if (!strncasecmp(q, "url=", 4)) { ! q += 4; ! if (*q == '\"') /* " */ ! q++; ! r = q; ! while (*r && !IS_SPACE(*r) && *r != ';') ! r++; ! s_tmp = Strnew_charp_n(q, r - q); ! ! if (s_tmp->ptr[s_tmp->length - 1] == '\"') { /* " */ ! s_tmp->length--; ! s_tmp->ptr[s_tmp->length] = '\0'; ! } ! q = r; ! } ! while (*q && *q != ';') ! q++; ! if (*q == ';') ! q++; ! } ! if (s_tmp) { ! q = htmlquote_str(s_tmp->ptr); ! tmp = Sprintf("Refresh (%d sec) %s", ! refresh, cur_hseq++, q, q); ! push_str(obuf, s_tmp->length, tmp, PC_ASCII); ! flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); ! if ( ! #ifdef CLEAR_BUF ! !is_redisplay && ! #endif /* CLEAR_BUF */ ! refresh == 0) { ! pushEvent(FUNCNAME_goURL, s_tmp->ptr); ! /* pushEvent(deletePrevBuf,NULL); */ ! } } } return 1; case HTML_BASE: *************** *** 3335,3350 **** HTMLlineproc2body(Buffer * buf, char *(*feed) (), int llimit) { Anchor *a_href = NULL, - *a_name = NULL, *a_img = NULL, *a_form = NULL; ! int cmd, ! status; char outc[LINELEN]; char *p, *q, *r, - *s, *str, *istr; Lineprop outp[LINELEN], --- 3372,3384 ---- HTMLlineproc2body(Buffer * buf, char *(*feed) (), int llimit) { Anchor *a_href = NULL, *a_img = NULL, *a_form = NULL; ! int status; char outc[LINELEN]; char *p, *q, *r, *str, *istr; Lineprop outp[LINELEN], *************** *** 3353,3361 **** prev_mode; int pos; int nlines; - Str tagbuf = Strnew(); - struct parsed_tagarg *t_arg, - *t; FILE *debug; struct frameset *frameset_s[FRAMESTACK_SIZE]; int frameset_sp = -1; --- 3387,3392 ---- *************** *** 3436,3444 **** #endif /* not JP_CHARSET */ else { /* tag processing */ ! tagbuf = Strnew(); status = R_ST_NORMAL; read_token(tagbuf, &str, &status, 0, 0); str--; q = tagbuf->ptr; cmd = gethtmlcmd(&q, &status); --- 3467,3480 ---- #endif /* not JP_CHARSET */ else { /* tag processing */ ! int cmd; ! Str tagbuf = Strnew(); ! struct parsed_tagarg *t_arg, ! *t; ! status = R_ST_NORMAL; read_token(tagbuf, &str, &status, 0, 0); + t_arg = parse_tag(tagbuf->ptr); str--; q = tagbuf->ptr; cmd = gethtmlcmd(&q, &status); *************** *** 3456,3476 **** effect &= ~PE_UNDER; break; case HTML_A: ! t_arg = parse_tag(tagbuf->ptr); ! p = q = r = s = NULL; hseq = 0; for (t = t_arg; t; t = t->next) { if (!strcasecmp(t->arg, "name") && t->value) { ! p = t->value; } else if (!strcasecmp(t->arg, "href") && t->value) { ! q = t->value; } else if (!strcasecmp(t->arg, "target") && t->value) { ! r = t->value; } else if (!strcasecmp(t->arg, "referer") && t->value) { ! s = t->value; } else if (!strcasecmp(t->arg, "hseq") && t->value) { hseq = atoi(t->value); --- 3492,3512 ---- effect &= ~PE_UNDER; break; case HTML_A: ! p = r = NULL; ! q = buf->baseTarget; hseq = 0; for (t = t_arg; t; t = t->next) { if (!strcasecmp(t->arg, "name") && t->value) { ! (void) registerName(buf, t->value, currentLn(buf), pos); } else if (!strcasecmp(t->arg, "href") && t->value) { ! p = t->value; } else if (!strcasecmp(t->arg, "target") && t->value) { ! q = t->value; } else if (!strcasecmp(t->arg, "referer") && t->value) { ! r = t->value; } else if (!strcasecmp(t->arg, "hseq") && t->value) { hseq = atoi(t->value); *************** *** 3479,3496 **** if (hseq > 0) buf->hmarklist = putHmarker(buf->hmarklist, currentLn(buf), pos, hseq - 1); - if (!r) - r = buf->baseTarget; if (p) { - a_name = registerName(buf, p, currentLn(buf), pos); - a_name->hseq = -1; - a_name = NULL; - } - if (q) { effect |= PE_ANCHOR; ! a_href = registerHref(buf, remove_space(q), r, s, currentLn(buf), pos); ! a_href->end.line = currentLn(buf); ! a_href->end.pos = pos; a_href->hseq = ((hseq > 0) ? hseq : -hseq) - 1; } break; --- 3515,3523 ---- if (hseq > 0) buf->hmarklist = putHmarker(buf->hmarklist, currentLn(buf), pos, hseq - 1); if (p) { effect |= PE_ANCHOR; ! a_href = registerHref(buf, remove_space(p), q, r, currentLn(buf), pos); a_href->hseq = ((hseq > 0) ? hseq : -hseq) - 1; } break; *************** *** 3502,3521 **** if (a_href->start.line == a_href->end.line && a_href->start.pos == a_href->end.pos) a_href->hseq = -1; } - a_href = NULL; - if (a_name) { - a_name->end.line = currentLn(buf); - a_name->end.pos = pos; - } - a_name = NULL; break; case HTML_IMG_ALT: - t_arg = parse_tag(tagbuf->ptr); for (t = t_arg; t; t = t->next) { if (!strcasecmp(t->arg, "src") && t->value) { a_img = registerImg(buf, t->value, currentLn(buf), pos); - a_img->hseq = -1; } } effect |= PE_IMAGE; --- 3529,3541 ---- if (a_href->start.line == a_href->end.line && a_href->start.pos == a_href->end.pos) a_href->hseq = -1; + a_href = NULL; } break; case HTML_IMG_ALT: for (t = t_arg; t; t = t->next) { if (!strcasecmp(t->arg, "src") && t->value) { a_img = registerImg(buf, t->value, currentLn(buf), pos); } } effect |= PE_IMAGE; *************** *** 3539,3545 **** if (form_sp < 0) break; /* outside of
..
*/ #endif /* not NEW_FORM */ - t_arg = parse_tag(tagbuf->ptr); hseq = 0; for (t = t_arg; t; t = t->next) { if (!strcasecmp(t->arg, "hseq") && t->value) { --- 3559,3564 ---- *************** *** 3552,3558 **** #endif /* NEW_FORM */ } #ifdef NEW_FORM ! if (form_id < 0) break; /* outside of
..
*/ form = forms[form_id]; #else /* not NEW_FORM */ --- 3571,3577 ---- #endif /* NEW_FORM */ } #ifdef NEW_FORM ! if (form_id < 0 || forms == NULL) break; /* outside of
..
*/ form = forms[form_id]; #else /* not NEW_FORM */ *************** *** 3589,3595 **** #ifndef NEW_FORM case HTML_FORM: case HTML_FORM_INT: - t_arg = parse_tag(tagbuf->ptr); p = "get"; q = "/"; r = NULL; --- 3608,3613 ---- *************** *** 3616,3622 **** #endif /* not NEW_FORM */ case HTML_MAP: p = NULL; - t_arg = parse_tag(tagbuf->ptr); for (t = t_arg; t; t = t->next) { if (!strcasecmp(t->arg, "name") && t->value) p = t->value; --- 3634,3639 ---- *************** *** 3637,3643 **** * .. */ break; p = NULL; - t_arg = parse_tag(tagbuf->ptr); for (t = t_arg; t; t = t->next) { if (!strcasecmp(t->arg, "href") && t->value) p = t->value; --- 3654,3659 ---- *************** *** 3647,3653 **** } break; case HTML_FRAMESET: - t_arg = parse_tag(tagbuf->ptr); frameset_sp++; if (frameset_sp >= FRAMESTACK_SIZE) break; --- 3663,3668 ---- *************** *** 3659,3668 **** buf->frameset = frameset_s[frameset_sp]; } else ! pushFrameTree(&(buf->frameQ), frameset_s[frameset_sp]); } else ! addFrameSet(frameset_s[frameset_sp - 1], frameset_s[frameset_sp]); break; case HTML_N_FRAMESET: if (frameset_sp >= 0) --- 3674,3684 ---- buf->frameset = frameset_s[frameset_sp]; } else ! pushFrameTree(&(buf->frameQ), frameset_s[frameset_sp], 0, 0); } else ! addFrameSetElement(frameset_s[frameset_sp - 1], ! (union frameset_element) frameset_s[frameset_sp]); break; case HTML_N_FRAMESET: if (frameset_sp >= 0) *************** *** 3670,3702 **** break; case HTML_FRAME: if (frameset_sp >= 0 && frameset_sp < FRAMESTACK_SIZE) { ! t_arg = parse_tag(tagbuf->ptr); ! addFrame(frameset_s[frameset_sp], t_arg, buf->baseURL); } break; case HTML_BASE: ! for (t_arg = parse_tag(tagbuf->ptr); t_arg; t_arg = t_arg->next) { ! if (!strcasecmp(t_arg->arg, "href") && t_arg->value) { if (!buf->baseURL) buf->baseURL = New(ParsedURL); ! parseURL(t_arg->value, buf->baseURL, NULL); } ! else if (!strcasecmp(t_arg->arg, "target") && t_arg->value) ! buf->baseTarget = t_arg->value; } break; case HTML_TITLE_ALT: ! for (t_arg = parse_tag(tagbuf->ptr); t_arg != NULL; t_arg = t_arg->next) { ! if (!strcasecmp(t_arg->arg, "title") && t_arg->value) { ! buf->buffername = t_arg->value; } } break; #ifndef KANJI_SYMBOLS case HTML_RULE: ! for (t_arg = parse_tag(tagbuf->ptr); t_arg != NULL; t_arg = t_arg->next) { ! if (!strcasecmp(t_arg->arg, "type") && t_arg->value) { ! effect |= (PC_ISRULE | PC_RULE_FLAG(atoi(t_arg->value))); break; } } --- 3686,3720 ---- break; case HTML_FRAME: if (frameset_sp >= 0 && frameset_sp < FRAMESTACK_SIZE) { ! union frameset_element element; ! ! element.body = newFrame(t_arg, buf->baseURL); ! addFrameSetElement(frameset_s[frameset_sp], element); } break; case HTML_BASE: ! for (t = t_arg; t; t = t->next) { ! if (!strcasecmp(t->arg, "href") && t->value) { if (!buf->baseURL) buf->baseURL = New(ParsedURL); ! parseURL(t->value, buf->baseURL, NULL); } ! else if (!strcasecmp(t->arg, "target") && t->value) ! buf->baseTarget = t->value; } break; case HTML_TITLE_ALT: ! for (t = t_arg; t; t = t->next) { ! if (!strcasecmp(t->arg, "title") && t->value) { ! buf->buffername = t->value; } } break; #ifndef KANJI_SYMBOLS case HTML_RULE: ! for (t = t_arg; t; t = t->next) { ! if (!strcasecmp(t->arg, "type") && t->value) { ! effect |= (PC_ISRULE | PC_RULE_FLAG(atoi(t->value))); break; } } *************** *** 3706,3715 **** break; #endif /* not KANJI_SYMBOLS */ } } } /* end of processing for one line */ ! addnewline(buf, outc, outp, pos); if (*str != '\0') { istr = str; goto proc_again; --- 3724,3740 ---- break; #endif /* not KANJI_SYMBOLS */ } + #ifdef ID_EXT + for (t = t_arg; t; t = t->next) { + if (!strcasecmp(t->arg, "id") && t->value) { + (void) registerName(buf, t->value, currentLn(buf), pos); + } + } + #endif /* ID_EXT */ } } /* end of processing for one line */ ! addnewline(buf, outc, outp, pos, nlines + 1); if (*str != '\0') { istr = str; goto proc_again; *************** *** 4054,4060 **** * Tag processing */ if (ST_IS_TAG(obuf->status)) { ! /*** continuation of a tag ***/ read_token(h_env->tagbuf, &str, &obuf->status, 0, 1); if (obuf->status != R_ST_NORMAL) { if (*str == '\0') { --- 4079,4085 ---- * Tag processing */ if (ST_IS_TAG(obuf->status)) { ! /*** continuation of a tag ***/ read_token(h_env->tagbuf, &str, &obuf->status, 0, 1); if (obuf->status != R_ST_NORMAL) { if (*str == '\0') { *************** *** 4108,4123 **** #ifdef ID_EXT targ = parse_tag(h_env->tagbuf->ptr); /* process tags */ ! if (HTMLtagproc1(cmd, targ, h_env) == 0) { #else /* process tags */ ! if (HTMLtagproc1(cmd, h_env) == 0) { #endif /* ID_EXT */ /* preserve the tag for second-stage processing */ push_tag(obuf, h_env->tagbuf->ptr, cmd); } #ifdef ID_EXT ! process_idattr(obuf, cmd, targ); #endif /* ID_EXT */ obuf->bp.init_flag = 1; clear_ignore_p_flag(cmd, obuf); --- 4133,4151 ---- #ifdef ID_EXT targ = parse_tag(h_env->tagbuf->ptr); /* process tags */ ! if (HTMLtagproc1(cmd, targ, h_env) == 0) #else /* process tags */ ! if (HTMLtagproc1(cmd, h_env) == 0) #endif /* ID_EXT */ + { /* preserve the tag for second-stage processing */ push_tag(obuf, h_env->tagbuf->ptr, cmd); } #ifdef ID_EXT ! else { ! process_idattr(obuf, cmd, targ); ! } #endif /* ID_EXT */ obuf->bp.init_flag = 1; clear_ignore_p_flag(cmd, obuf); *************** *** 4247,4253 **** } } } ! { char *tp; int i = 0; --- 4275,4281 ---- } } } ! if (!(obuf->flag & (RB_PREMODE | RB_NOBR))) { char *tp; int i = 0; *************** *** 4261,4267 **** if (tp > obuf->line->ptr && tp[-1] == ' ') i = 1; indent = h_env->envs[h_env->envc].indent; ! if (!(obuf->flag & (RB_PREMODE | RB_NOBR)) && obuf->pos - i > h_env->limit) { #ifdef FORMAT_NICE obuf->flag |= RB_FILL; #endif /* FORMAT_NICE */ --- 4289,4295 ---- if (tp > obuf->line->ptr && tp[-1] == ' ') i = 1; indent = h_env->envs[h_env->envc].indent; ! if (obuf->pos - i > h_env->limit) { #ifdef FORMAT_NICE obuf->flag |= RB_FILL; #endif /* FORMAT_NICE */ *************** *** 4289,4295 **** extern Lineprop NullProp[]; static void ! addnewline(Buffer * buf, char *line, Lineprop * prop, int pos) { Line *l; l = New(Line); --- 4317,4323 ---- extern Lineprop NullProp[]; static void ! addnewline(Buffer * buf, char *line, Lineprop * prop, int pos, int nlines) { Line *l; l = New(Line); *************** *** 4317,4322 **** --- 4345,4355 ---- if (buf->firstLine == NULL) buf->firstLine = l; l->linenumber = ++buf->allLine; + if (nlines < 0) { + l->real_linenumber = l->linenumber; + } else { + l->real_linenumber = nlines; + } l = NULL; } *************** *** 4556,4561 **** --- 4589,4598 ---- htmlenv1.buf = newTextList(); code = '\0'; + #if 0 + do_blankline(&htmlenv1, &obuf, 0, 0, htmlenv1.limit); + obuf.flag = RB_IGNORE_P; + #endif while (!f->iseof) { lineBuf2 = StrmyUFgets(f); if (lineBuf2->length == 0) { *************** *** 4798,4804 **** term_cbreak(); } ! if (uf->scheme != SCM_LOCAL) { tmpf = Sprintf("%s/w3msrc%d.%lx", rc_dir, getpid(), (unsigned long) newBuf); src = fopen(tmpf->ptr, "w"); if (src) --- 4835,4841 ---- term_cbreak(); } ! if (newBuf->sourcefile == NULL && uf->scheme != SCM_LOCAL) { tmpf = Sprintf("%s/w3msrc%d.%lx", rc_dir, getpid(), (unsigned long) newBuf); src = fopen(tmpf->ptr, "w"); if (src) *************** *** 4824,4829 **** --- 4861,4867 ---- if (squeezeBlankLine) { if (pre_lbuf) { if (lineBuf2->ptr[0] == '\n' && pre_lbuf->ptr[0] == '\n') { + ++nlines; pre_lbuf = lineBuf2; continue; } *************** *** 4849,4856 **** } linelen += lineBuf2->length; showProgress(&linelen, &trbyte); if (showLineNum) { ! Str tmp = Sprintf("%4d:", ++nlines); Strcat(tmp, lineBuf2); lineBuf2 = tmp; } --- 4887,4895 ---- } linelen += lineBuf2->length; showProgress(&linelen, &trbyte); + ++nlines; if (showLineNum) { ! Str tmp = Sprintf("%4d:", nlines); Strcat(tmp, lineBuf2); lineBuf2 = tmp; } *************** *** 4867,4884 **** j = 0; for (i = 0; lineBuf2->ptr[i]; i++) { if (lineBuf2->ptr[i] == '\r') { ! addnewline(newBuf, &lineBuf2->ptr[j], &propBuffer[j], i - j); if (lineBuf2->ptr[i + 1] == '\n') i++; j = i + 1; } else if (lineBuf2->ptr[i] == '\n') { ! addnewline(newBuf, &lineBuf2->ptr[j], &propBuffer[j], i - j); j = i + 1; } } if (lineBuf2->ptr[i - 1] != '\n' && lineBuf2->ptr[i - 1] != '\r') ! addnewline(newBuf, &lineBuf2->ptr[j], &propBuffer[j], i - j); } _end: if (fmInitialized) { --- 4906,4923 ---- j = 0; for (i = 0; lineBuf2->ptr[i]; i++) { if (lineBuf2->ptr[i] == '\r') { ! addnewline(newBuf, &lineBuf2->ptr[j], &propBuffer[j], i - j, nlines); if (lineBuf2->ptr[i + 1] == '\n') i++; j = i + 1; } else if (lineBuf2->ptr[i] == '\n') { ! addnewline(newBuf, &lineBuf2->ptr[j], &propBuffer[j], i - j, nlines); j = i + 1; } } if (lineBuf2->ptr[i - 1] != '\n' && lineBuf2->ptr[i - 1] != '\r') ! addnewline(newBuf, &lineBuf2->ptr[j], &propBuffer[j], i - j, nlines); } _end: if (fmInitialized) { *************** *** 5079,5086 **** Str lbuf; static Str pre_lbuf = NULL; #ifdef JP_CHARSET ! char code; #endif if (buf->pagerSource == NULL) return NULL; --- 5118,5126 ---- Str lbuf; static Str pre_lbuf = NULL; #ifdef JP_CHARSET ! char code = buf->document_code; #endif + int squeeze_flag = 0; if (buf->pagerSource == NULL) return NULL; *************** *** 5088,5094 **** if (fmInitialized) crmode(); if (pl != NULL) ! n = pl->linenumber; if (n == 0) pre_lbuf = NULL; --- 5128,5134 ---- if (fmInitialized) crmode(); if (pl != NULL) ! n = pl->real_linenumber; if (n == 0) pre_lbuf = NULL; *************** *** 5107,5115 **** } if (squeezeBlankLine) { if (pre_lbuf) { if (lbuf->ptr[0] == '\n' && pre_lbuf->ptr[0] == '\n') { ! pl->linenumber = ++n; pre_lbuf = lbuf; continue; } } --- 5147,5158 ---- } if (squeezeBlankLine) { if (pre_lbuf) { + squeeze_flag = 0; if (lbuf->ptr[0] == '\n' && pre_lbuf->ptr[0] == '\n') { ! ++n; pre_lbuf = lbuf; + squeeze_flag = 1; + i--; continue; } } *************** *** 5132,5138 **** bcopy((void *) propBuffer, (void *) l->propBuf, len * sizeof(Lineprop)); l->len = len; l->prev = pl; ! l->linenumber = ++n; if (pl == NULL) { pl = l; buf->firstLine = buf->topLine = buf->currentLine = l; --- 5175,5187 ---- bcopy((void *) propBuffer, (void *) l->propBuf, len * sizeof(Lineprop)); l->len = len; l->prev = pl; ! ++n; ! if (squeezeBlankLine) { ! l->real_linenumber = n; ! l->linenumber = (pl == NULL ? n : pl->linenumber + 1); ! } else { ! l->real_linenumber = l->linenumber = n; ! } if (pl == NULL) { pl = l; buf->firstLine = buf->topLine = buf->currentLine = l; *************** *** 5156,5163 **** --- 5205,5220 ---- if (pl != NULL) pl->next = NULL; buf->lastLine = pl; + if (rl == NULL && squeeze_flag) { + rl = pl; + } if (fmInitialized) term_raw(); + #ifdef JP_CHARSET + if (code != '\0') { + buf->document_code = code; + } + #endif return rl; } *************** *** 5227,5233 **** tmpf = Sprintf("%s/w3mv%d-%d", rc_dir, (int) getpid(), external_seq++); if (uf.ext && *uf.ext) { - Strcat_char(tmpf,'.'); Strcat_charp(tmpf,uf.ext); } if (save2tmp(uf, tmpf->ptr) < 0) --- 5284,5289 ---- *************** *** 5577,5582 **** --- 5633,5643 ---- if (uf.stream.f == NULL) return; is_redisplay = TRUE; + buf->allLine = 0; + buf->href = NULL; + buf->name = NULL; + buf->img = NULL; + buf->formitem = NULL; if (!strcasecmp(buf->type,"text/html")) loadHTMLBuffer(&uf,buf); else diff -c w3m/fm.h w3m-0.1.10-pre+666/fm.h *** w3m/fm.h Wed May 17 18:04:19 2000 --- w3m-0.1.10-pre+666/fm.h Tue May 23 18:10:45 2000 *************** *** 222,234 **** struct _Line *next; struct _Line *prev; short len; ! long linenumber; unsigned short usrflags; } Line; typedef struct { ! short line; ! short pos; } BufferPoint; typedef struct _anchor { --- 222,235 ---- struct _Line *next; struct _Line *prev; short len; ! long linenumber; /* on buffer */ ! long real_linenumber; /* on file */ unsigned short usrflags; } Line; typedef struct { ! int line; ! short pos; } BufferPoint; typedef struct _anchor { *************** *** 358,391 **** #define in_under fontstat[1] #define in_stand fontstat[2] ! #define RB_PRE 0x01 ! #define RB_XMPMODE 0x02 ! #define RB_LSTMODE 0x04 ! #define RB_PLAIN 0x08 ! #define RB_LEFT 0x00 ! #define RB_CENTER 0x10 ! #define RB_RIGHT 0x20 ! #ifdef FORMAT_NICE ! #define RB_FILL 0x200000 ! #endif /* FORMAT_NICE */ ! #define RB_NOBR 0x40 ! #define RB_P 0x80 ! #define RB_PRE_INT 0x100 ! ! #define RB_SPECIAL (RB_PRE|RB_XMPMODE|RB_LSTMODE|RB_PLAIN|RB_NOBR|RB_PRE_INT) ! #define RB_PREMODE (RB_PRE | RB_PRE_INT) ! #define RB_ALIGN (RB_CENTER | RB_RIGHT) ! ! #define RB_INTXTA 0x400 ! #define RB_IGNORE 0x1000 ! #define RB_INSEL 0x2000 ! #define RB_IGNORE_P 0x4000 #ifdef MENU ! #define RB_INSELECT 0x800 #endif /* MENU */ ! #define RB_IN_DT 0x200 ! #define RB_N_TABLE 0x100000 #define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN) #define RB_SET_ALIGN(obuf,align) {(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= (align); } --- 359,392 ---- #define in_under fontstat[1] #define in_stand fontstat[2] ! #define RB_PRE 0x01 ! #define RB_XMPMODE 0x02 ! #define RB_LSTMODE 0x04 ! #define RB_PLAIN 0x08 ! #define RB_LEFT 0x00 ! #define RB_CENTER 0x10 ! #define RB_RIGHT 0x20 ! #define RB_ALIGN (RB_CENTER | RB_RIGHT) ! #define RB_NOBR 0x40 ! #define RB_P 0x80 ! #define RB_PRE_INT 0x100 ! #define RB_PREMODE (RB_PRE | RB_PRE_INT) ! #define RB_SPECIAL (RB_PRE|RB_XMPMODE|RB_LSTMODE|RB_PLAIN|RB_NOBR|RB_PRE_INT) ! ! #define RB_IN_DT 0x200 ! #define RB_INTXTA 0x400 #ifdef MENU ! #define RB_INSELECT 0x800 #endif /* MENU */ ! #define RB_IGNORE 0x1000 ! #define RB_INSEL 0x2000 ! #define RB_IGNORE_P 0x4000 ! #define RB_TITLE 0x8000 ! #define RB_N_TABLE 0x100000 ! #ifdef FORMAT_NICE ! #define RB_FILL 0x200000 ! #endif /* FORMAT_NICE */ #define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN) #define RB_SET_ALIGN(obuf,align) {(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= (align); } diff -c w3m/form.c w3m-0.1.10-pre+666/form.c *** w3m/form.c Mon Apr 24 10:41:18 2000 --- w3m-0.1.10-pre+666/form.c Tue May 23 18:25:23 2000 *************** *** 225,237 **** } void formUpdateBuffer(Anchor * a, Buffer * buf, FormItemList * form) { int i, j, c_type = PC_ASCII; Buffer save; ! char *p = form->value->ptr; int spos, epos; --- 225,278 ---- } void + formResetBuffer(Buffer * buf, AnchorList * formitem) + { + int i; + Anchor *a; + FormItemList *f1, *f2; + + if (buf == NULL || buf->formitem == NULL || formitem == NULL) + return; + for (i = 0; i < buf->formitem->nanchor && i < formitem->nanchor; i++) { + a = &buf->formitem->anchors[i]; + f1 = (FormItemList *) a->url; + f2 = (FormItemList *) formitem->anchors[i].url; + if (f1->type != f2->type || + strcmp(((f1->name == NULL) ? "" : f1->name->ptr), + ((f2->name == NULL) ? "" : f2->name->ptr))) + break; /* What's happening */ + switch(f1->type) { + case FORM_INPUT_TEXT: + case FORM_INPUT_PASSWORD: + case FORM_INPUT_FILE: + case FORM_TEXTAREA: + f1->value = f2->value; + break; + case FORM_INPUT_CHECKBOX: + case FORM_INPUT_RADIO: + f1->checked = f2->checked; + break; + case FORM_SELECT: + #ifdef MENU_SELECT + f1->select_option = f2->select_option; + f1->label = f2->label; + #endif + break; + default: + continue; + } + formUpdateBuffer(a, buf, f1); + } + } + + void formUpdateBuffer(Anchor * a, Buffer * buf, FormItemList * form) { int i, j, c_type = PC_ASCII; Buffer save; ! char *p; int spos, epos; *************** *** 262,276 **** else buf->currentLine->lineBuf[spos + 1] = ' '; break; - #ifdef MENU_SELECT - case FORM_SELECT: - p = form->label->ptr; - /* continue to the next label */ - #endif /* MENU_SELECT */ case FORM_INPUT_TEXT: case FORM_INPUT_FILE: case FORM_INPUT_PASSWORD: case FORM_TEXTAREA: j = 0; for (i = spos + 1; i < epos; i++) { if (p[j] == '\0') --- 303,319 ---- else buf->currentLine->lineBuf[spos + 1] = ' '; break; case FORM_INPUT_TEXT: case FORM_INPUT_FILE: case FORM_INPUT_PASSWORD: case FORM_TEXTAREA: + #ifdef MENU_SELECT + case FORM_SELECT: + if (form->type == FORM_SELECT) + p = form->label->ptr; + else + #endif /* MENU_SELECT */ + p = form->value->ptr; j = 0; for (i = spos + 1; i < epos; i++) { if (p[j] == '\0') *************** *** 281,290 **** else if (p[j] & 0x80) c_type = PC_KANJI1; #endif /* JP_CHARSET */ ! else if (p[j] & ~0x1f) ! c_type = PC_ASCII; ! else c_type = PC_CTRL; SetCharType(buf->currentLine->propBuf[i], c_type); if (form->type == FORM_INPUT_PASSWORD) --- 324,333 ---- else if (p[j] & 0x80) c_type = PC_KANJI1; #endif /* JP_CHARSET */ ! else if (IS_CNTRL(p[j])) c_type = PC_CTRL; + else + c_type = PC_ASCII; SetCharType(buf->currentLine->propBuf[i], c_type); if (form->type == FORM_INPUT_PASSWORD) *************** *** 322,330 **** { int c_type = PC_ASCII; Str n = Strnew_size(width + 2); ! int i; ! for (i = 0; i < width && i < s->length; i++) { #ifdef JP_CHARSET if (c_type == PC_KANJI1) c_type = PC_KANJI2; --- 365,373 ---- { int c_type = PC_ASCII; Str n = Strnew_size(width + 2); ! int i, j; ! for (i = 0, j = 0; j < width && i < s->length; i++, j++) { #ifdef JP_CHARSET if (c_type == PC_KANJI1) c_type = PC_KANJI2; *************** *** 333,341 **** else #endif /* JP_CHARSET */ c_type = PC_ASCII; ! if (!(s->ptr[i] & 0x80) && s->ptr[i] < ' ') ! Strcat_char(n, ' '); ! else if (s->ptr[i] == '&') Strcat_charp(n, "&"); else if (s->ptr[i] == '<') Strcat_charp(n, "<"); --- 376,387 ---- else #endif /* JP_CHARSET */ c_type = PC_ASCII; ! if (IS_CNTRL(s->ptr[i])) { ! if (s->ptr[i] != '\r') ! Strcat_char(n, ' '); ! else ! j--; ! } else if (s->ptr[i] == '&') Strcat_charp(n, "&"); else if (s->ptr[i] == '<') Strcat_charp(n, "<"); *************** *** 347,356 **** #ifdef JP_CHARSET if (c_type == PC_KANJI1) { Strshrink(n, 1); ! i--; } #endif /* JP_CHARSET */ ! for (; i < width; i++) Strcat_char(n, ' '); return n; } --- 393,402 ---- #ifdef JP_CHARSET if (c_type == PC_KANJI1) { Strshrink(n, 1); ! j--; } #endif /* JP_CHARSET */ ! for (; j < width; j++) Strcat_char(n, ' '); return n; } diff -c w3m/frame.c w3m-0.1.10-pre+666/frame.c *** w3m/frame.c Wed May 17 18:04:19 2000 --- w3m-0.1.10-pre+666/frame.c Tue May 23 18:24:21 2000 *************** *** 112,126 **** return f; } ! void ! addFrame(struct frameset *f, struct parsed_tagarg *arg, ParsedURL *baseURL) { struct parsed_tagarg *t; struct frame_body *body; - if (f == NULL || f->i >= f->col * f->row) - return; - body = New(struct frame_body); body->attr = F_UNLOADED; body->name = NULL; --- 112,123 ---- return f; } ! struct frame_body * ! newFrame(struct parsed_tagarg *arg, ParsedURL *baseURL) { struct parsed_tagarg *t; struct frame_body *body; body = New(struct frame_body); body->attr = F_UNLOADED; body->name = NULL; *************** *** 136,143 **** } else if (!strcasecmp(t->arg, "name") && t->value && *t->value != '_') body->name = t->value; } ! f->frame[f->i].body = body; ! f->i++; } void --- 133,139 ---- } else if (!strcasecmp(t->arg, "name") && t->value && *t->value != '_') body->name = t->value; } ! return body; } void *************** *** 156,162 **** } void ! addFrameSet(struct frameset *f, struct frameset *fset) { int i; --- 152,158 ---- } void ! addFrameSetElement(struct frameset *f, union frameset_element element) { int i; *************** *** 165,171 **** i = f->i; if (i >= f->col * f->row) return; ! f->frame[i].set = fset; f->i++; } --- 161,167 ---- i = f->i; if (i >= f->col * f->row) return; ! f->frame[i] = element; f->i++; } *************** *** 255,261 **** } void ! pushFrameTree(struct frameset_queue **fqpp, struct frameset *fs) { struct frameset_queue *rfq, *cfq = *fqpp; --- 251,260 ---- } void ! pushFrameTree(struct frameset_queue **fqpp, ! struct frameset *fs, ! long linenumber, ! short pos) { struct frameset_queue *rfq, *cfq = *fqpp; *************** *** 264,269 **** --- 263,271 ---- return; rfq = New(struct frameset_queue); + rfq->linenumber = linenumber; + rfq->pos = pos; + rfq->back = cfq; if (cfq) { rfq->next = cfq->next; *************** *** 279,285 **** } struct frameset * ! popFrameTree(struct frameset_queue **fqpp) { struct frameset_queue *rfq = NULL, *cfq = *fqpp; --- 281,289 ---- } struct frameset * ! popFrameTree(struct frameset_queue **fqpp, ! long *linenumber, ! short *pos) { struct frameset_queue *rfq = NULL, *cfq = *fqpp; *************** *** 288,293 **** --- 292,302 ---- if (!cfq) return rfs; + if (linenumber) + *linenumber = cfq->linenumber; + if (pos) + *pos = cfq->pos; + rfs = cfq->frameset; if (cfq->next) { (rfq = cfq->next)->back = cfq->back; *************** *** 316,336 **** f_element->set = buf->frameset; f_element->set->currentURL = New(ParsedURL); copyParsedURL(f_element->set->currentURL, &buf->currentURL); ! buf->frameset = popFrameTree(&(buf->frameQ)); f_element->set->name = f_name; } else { ! f_body = copyFrame(f_element->body); ! deleteFrameSetElement(*f_element); f_body->name = f_name; f_body->url = parsedURL2Str(&buf->currentURL)->ptr; - f_body->baseURL = buf->baseURL; - f_body->flags = 0; if (buf->real_scheme == SCM_LOCAL) { f_body->source = buf->sourcefile; } else { ! Str tmp = Sprintf("%s/w3mframe%d.%d", rc_dir, getpid(), frameFileSeq++); rename(buf->sourcefile, tmp->ptr); f_body->source = tmp->ptr; f_body->flags |= FB_TODELETE; --- 325,344 ---- f_element->set = buf->frameset; f_element->set->currentURL = New(ParsedURL); copyParsedURL(f_element->set->currentURL, &buf->currentURL); ! buf->frameset = popFrameTree(&(buf->frameQ), NULL, NULL); f_element->set->name = f_name; } else { ! f_body = newFrame(NULL, buf->baseURL); ! f_body->attr = F_BODY; f_body->name = f_name; f_body->url = parsedURL2Str(&buf->currentURL)->ptr; if (buf->real_scheme == SCM_LOCAL) { f_body->source = buf->sourcefile; } else { ! Str tmp = Sprintf("%s/w3mframe%d.%d", ! rc_dir, getpid(), frameFileSeq++); rename(buf->sourcefile, tmp->ptr); f_body->source = tmp->ptr; f_body->flags |= FB_TODELETE; *************** *** 338,343 **** --- 346,352 ---- } f_body->referer = referer; f_body->request = request; + deleteFrameSetElement(*f_element); f_element->body = f_body; } } *************** *** 384,390 **** if (buf == NULL || buf == NO_BUFFER) { b->source = NULL; ! b->flags = 0; return NULL; } if (buf->firstLine == NULL) { --- 393,399 ---- if (buf == NULL || buf == NO_BUFFER) { b->source = NULL; ! b->flags = (buf == NO_BUFFER) ? FB_NO_BUFFER : 0; return NULL; } if (buf->firstLine == NULL) { *************** *** 403,409 **** if (buf->frameset) { ret_frameset = buf->frameset; ret_frameset->name = b->name; ! buf->frameset = popFrameTree(&(buf->frameQ)); } discardBuffer(buf); return ret_frameset; --- 412,420 ---- if (buf->frameset) { ret_frameset = buf->frameset; ret_frameset->name = b->name; ! ret_frameset->currentURL = New(ParsedURL); ! copyParsedURL(ret_frameset->currentURL, &buf->currentURL); ! buf->frameset = popFrameTree(&(buf->frameQ), NULL, NULL); } discardBuffer(buf); return ret_frameset; *************** *** 472,494 **** fputs("\n", f1); for (c = 0; c < f->col; c++) { union frameset_element frame; ! struct frameset *f_frameset; ! int i = c + r * f->col; frame = f->frame[i]; ! if (!r) { ! fprintf(f1, "\n", f->width[c]); ! } ! else { ! fputs("\n", f1); ! } if (frame.element == NULL) { ! fputs("\n", f1); continue; } switch (frame.element->attr) { default: ! fprintf(f1, "Frameset %s: Illegal frame description", f->name); break; case F_UNLOADED: if (!frame.body->name && f->name) { --- 483,509 ---- fputs("\n", f1); for (c = 0; c < f->col; c++) { union frameset_element frame; ! struct frameset *f_frameset; ! int i = c + r * f->col; frame = f->frame[i]; ! if (frame.element == NULL) { ! fputs("\n\n", f1); continue; } + + fputs("name) + fprintf(f1, " id=\"_%s\"", frame.element->name); + if (!r) + fprintf(f1, " width=\"%s\"", f->width[c]); + fputs(">\n", f1); + switch (frame.element->attr) { default: ! fprintf(f1, "Frameset \"%s\" frame %d: type unrecognized", ! f->name, i + 1); break; case F_UNLOADED: if (!frame.body->name && f->name) { *************** *** 508,514 **** if (frame.body->source == NULL || (f2 = fopen(frame.body->source, "r")) == NULL) { frame.body->attr = F_UNLOADED; ! fprintf(f1, "Can't open %s", frame.body->url); break; } parseURL2(frame.body->url, &base, currentURL); --- 523,532 ---- if (frame.body->source == NULL || (f2 = fopen(frame.body->source, "r")) == NULL) { frame.body->attr = F_UNLOADED; ! if (frame.body->flags & FB_NO_BUFFER) ! fprintf(f1, "Open %s with other method", frame.body->url); ! else ! fprintf(f1, "Can't open %s", frame.body->url); break; } parseURL2(frame.body->url, &base, currentURL); *************** *** 718,724 **** struct frameset *fset; tmp = Sprintf("%s/w3mframe%d.%lx.html", rc_dir, getpid(), ! (unsigned long) Cbuf->frameQ); f = fopen(tmp->ptr, "w"); if (f == NULL) return NULL; --- 736,742 ---- struct frameset *fset; tmp = Sprintf("%s/w3mframe%d.%lx.html", rc_dir, getpid(), ! (unsigned long) Cbuf->frameset); f = fopen(tmp->ptr, "w"); if (f == NULL) return NULL; *************** *** 732,738 **** if ((Cbuf->currentURL).is_nocache) flag |= RG_NOCACHE; buf = loadGeneralFile(tmp->ptr, NULL, NULL, flag, NULL); ! if (buf == NULL) return NULL; buf->sourcefile = tmp->ptr; buf->bufferprop |= BP_FRAME; --- 750,756 ---- if ((Cbuf->currentURL).is_nocache) flag |= RG_NOCACHE; buf = loadGeneralFile(tmp->ptr, NULL, NULL, flag, NULL); ! if (buf == NULL || buf == NO_BUFFER) return NULL; buf->sourcefile = tmp->ptr; buf->bufferprop |= BP_FRAME; diff -c w3m/frame.h w3m-0.1.10-pre+666/frame.h *** w3m/frame.h Tue May 16 17:26:37 2000 --- w3m-0.1.10-pre+666/frame.h Tue May 23 18:09:50 2000 *************** *** 3,52 **** */ struct frame_element { ! char attr; #define F_UNLOADED 0x00 #define F_BODY 0x01 #define F_FRAMESET 0x02 ! char dummy; ! char *name; }; struct frame_body { ! char attr; ! char flags; #define FB_NOCACHE 0x01 #define FB_TODELETE 0x02 ! char *name; ! char *url; ParsedURL *baseURL; ! char *source; ! char *referer; ! FormList *request; }; union frameset_element { struct frame_element *element; ! struct frame_body *body; ! struct frameset *set; }; struct frameset { ! char attr; ! char dummy; ! char *name; ParsedURL *currentURL; ! char **width; ! char **height; ! int col; ! int row; ! int i; union frameset_element *frame; }; struct frameset_queue { struct frameset_queue *next; struct frameset_queue *back; ! struct frameset *frameset; ! short currentColumn; ! short pos; }; --- 3,53 ---- */ struct frame_element { ! char attr; #define F_UNLOADED 0x00 #define F_BODY 0x01 #define F_FRAMESET 0x02 ! char dummy; ! char *name; }; struct frame_body { ! char attr; ! char flags; #define FB_NOCACHE 0x01 #define FB_TODELETE 0x02 ! #define FB_NO_BUFFER 0x04 ! char *name; ! char *url; ParsedURL *baseURL; ! char *source; ! char *referer; ! FormList *request; }; union frameset_element { struct frame_element *element; ! struct frame_body *body; ! struct frameset *set; }; struct frameset { ! char attr; ! char dummy; ! char *name; ParsedURL *currentURL; ! char **width; ! char **height; ! int col; ! int row; ! int i; union frameset_element *frame; }; struct frameset_queue { struct frameset_queue *next; struct frameset_queue *back; ! struct frameset *frameset; ! long linenumber; ! short pos; }; Common subdirectories: w3m/gc and w3m-0.1.10-pre+666/gc diff -c w3m/indep.c w3m-0.1.10-pre+666/indep.c *** w3m/indep.c Tue May 16 16:55:53 2000 --- w3m-0.1.10-pre+666/indep.c Tue May 23 18:24:21 2000 *************** *** 530,536 **** c = x->ptr[i]; if (c == ' ') Strcat_char(r, '+'); ! else if ((IS_ALNUM(c) || is_safe(c) || c == '/') && !(c & 0x80)) { Strcat_char(r, c); } else { --- 530,536 ---- c = x->ptr[i]; if (c == ' ') Strcat_char(r, '+'); ! else if ((IS_ALNUM(c) || is_safe(c)) && !(c & 0x80)) { Strcat_char(r, c); } else { diff -c w3m/mailcap.c w3m-0.1.10-pre+666/mailcap.c *** w3m/mailcap.c Fri Apr 21 09:51:59 2000 --- w3m-0.1.10-pre+666/mailcap.c Tue May 23 18:06:39 2000 *************** *** 14,20 **** static struct mailcap DefaultMailcap[] = { ! {"image/*", "xv %s"}, {"audio/basic", "showaudio %s"}, {NULL, NULL} }; --- 14,20 ---- static struct mailcap DefaultMailcap[] = { ! {"image/*", "xv %s"}, /* */ {"audio/basic", "showaudio %s"}, {NULL, NULL} }; diff -c w3m/main.c w3m-0.1.10-pre+666/main.c *** w3m/main.c Wed May 17 18:04:19 2000 --- w3m-0.1.10-pre+666/main.c Tue May 23 18:25:11 2000 *************** *** 156,163 **** BookmarkFile = NULL; rc_dir = expandName(RC_DIR); i = strlen(rc_dir); ! if (i > 1 && rc_dir[i] == '/') ! rc_dir[i] = '\0'; config_file = rcFile("config"); create_option_search_table(); --- 156,163 ---- BookmarkFile = NULL; rc_dir = expandName(RC_DIR); i = strlen(rc_dir); ! if (i > 1 && rc_dir[i-1] == '/') ! rc_dir[i-1] = '\0'; config_file = rcFile("config"); create_option_search_table(); *************** *** 229,235 **** Mailer = p; /* argument search 2 */ ! for (i = 1; i < argc; i++) { if (*argv[i] == '-') { if (!strcmp("-t", argv[i])) { Tabstop = atoi(argv[++i]); --- 229,248 ---- Mailer = p; /* argument search 2 */ ! i = 0; ! p = argv[0]; ! p += strlen(p); ! while (p > argv[0] && p[-1] != '/') { ! p--; ! } ! if (!strncmp(p, "w3m", 3)) { ! p += 3; ! } ! if (*p == '\0') ! i++; ! else ! argv[0] = p; ! while (i < argc) { if (*argv[i] == '-') { if (!strcmp("-t", argv[i])) { Tabstop = atoi(argv[++i]); *************** *** 371,376 **** --- 384,390 ---- else { load_argv[load_argc++] = argv[i]; } + i++; } if (option_assigned) { *************** *** 391,398 **** if (BookmarkFile == NULL) BookmarkFile = rcFile(BOOKMARK); ! if (!isatty(1) && !w3m_dump && !w3m_halfdump) { /* redirected ! * output */ w3m_dump = TRUE; if (COLS == 0) COLS = 80; --- 405,412 ---- if (BookmarkFile == NULL) BookmarkFile = rcFile(BOOKMARK); ! if (!isatty(1) && !w3m_dump && !w3m_halfdump) { ! /* redirected output */ w3m_dump = TRUE; if (COLS == 0) COLS = 80; *************** *** 413,424 **** if (newbuf == NULL) fprintf(stderr, "w3m: Can't load bookmark\n"); } - else if ((p = getenv("HTTP_HOME")) != NULL || - (p = getenv("WWW_HOME")) != NULL) { - newbuf = loadGeneralFile(p, NULL, NO_REFERER, 0, NULL); - if (newbuf == NULL) - fprintf(stderr, "w3m: Can't load %s\n", p); - } else if (visual_start) { Str s_page; s_page = Strnew_charp("W3M startup page
Welcome to "); --- 427,432 ---- *************** *** 443,448 **** --- 451,462 ---- fprintf(stderr, "w3m: Can't load string\n"); else newbuf->bufferprop |= (BP_INTERNAL | BP_NO_URL); + } + else if ((p = getenv("HTTP_HOME")) != NULL || + (p = getenv("WWW_HOME")) != NULL) { + newbuf = loadGeneralFile(p, NULL, NO_REFERER, 0, NULL); + if (newbuf == NULL) + fprintf(stderr, "w3m: Can't load %s\n", p); } else { if (fmInitialized) *************** *** 492,497 **** --- 506,513 ---- break; } } + if (newbuf == NO_BUFFER) + continue; if (w3m_halfdump) { Currentbuf = Firstbuf = newbuf; printf("%s\n", newbuf->buffername); *************** *** 521,527 **** Currentbuf->nextBuffer = newbuf; Currentbuf = newbuf; } ! if (Currentbuf->frameset != NULL && RenderFrame) { rFrame(); Currentbuf = newbuf; } --- 537,544 ---- Currentbuf->nextBuffer = newbuf; Currentbuf = newbuf; } ! if (Currentbuf && Currentbuf != NO_BUFFER && ! RenderFrame && Currentbuf->frameset != NULL) { rFrame(); Currentbuf = newbuf; } *************** *** 530,536 **** #endif } ! if (Firstbuf == NULL) { if (newbuf == NO_BUFFER) { if (fmInitialized) inputStr("Hit any key to quit w3m:", ""); --- 547,553 ---- #endif } ! if (!Firstbuf || Firstbuf == NO_BUFFER) { if (newbuf == NO_BUFFER) { if (fmInitialized) inputStr("Hit any key to quit w3m:", ""); *************** *** 718,724 **** buf->topLine = NULL; buf->currentLine = NULL; buf->lastLine = NULL; - buf->allLine = 0; } } #endif --- 735,740 ---- *************** *** 820,828 **** if (Currentbuf->firstLine == NULL) return; #ifdef VI_PREC_NUM ! Currentbuf->topLine = lineSkip(Currentbuf->topLine, PREC_NUM * (LASTLINE - 1)); #else /* not VI_PREC_NUM */ ! Currentbuf->topLine = lineSkip(Currentbuf->topLine, prec_num ? prec_num : LASTLINE - 1); #endif /* not VI_PREC_NUM */ curHome(); } --- 836,844 ---- if (Currentbuf->firstLine == NULL) return; #ifdef VI_PREC_NUM ! Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine, PREC_NUM * (LASTLINE - 1), FALSE); #else /* not VI_PREC_NUM */ ! Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine, prec_num ? prec_num : LASTLINE - 1, FALSE); #endif /* not VI_PREC_NUM */ curHome(); } *************** *** 834,842 **** if (Currentbuf->firstLine == NULL) return; #ifdef VI_PREC_NUM ! Currentbuf->topLine = lineSkip(Currentbuf->topLine, PREC_NUM * (-LASTLINE + 1)); #else /* not VI_PREC_NUM */ ! Currentbuf->topLine = lineSkip(Currentbuf->topLine, prec_num ? -prec_num : -LASTLINE + 1); #endif /* not VI_PREC_NUM */ curHome(); } --- 850,858 ---- if (Currentbuf->firstLine == NULL) return; #ifdef VI_PREC_NUM ! Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine, PREC_NUM * (-LASTLINE + 1), FALSE); #else /* not VI_PREC_NUM */ ! Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine, prec_num ? -prec_num : -LASTLINE + 1, FALSE); #endif /* not VI_PREC_NUM */ curHome(); } *************** *** 857,863 **** if (Currentbuf->firstLine == NULL) return; lnum = Currentbuf->currentLine->linenumber; ! Currentbuf->topLine = lineSkip(curtop, n); if (Currentbuf->topLine == curtop) return; --- 873,879 ---- if (Currentbuf->firstLine == NULL) return; lnum = Currentbuf->currentLine->linenumber; ! Currentbuf->topLine = lineSkip(Currentbuf, curtop, n, FALSE); if (Currentbuf->topLine == curtop) return; *************** *** 899,906 **** return; offsety = LASTLINE / 2 - Currentbuf->cursorY; if (offsety != 0) { ! /* Currentbuf->currentLine = lineSkip(Currentbuf->currentLine,offsety); */ ! Currentbuf->topLine = lineSkip(Currentbuf->topLine, -offsety); arrangeCursor(Currentbuf); displayBuffer(Currentbuf, B_NORMAL); } --- 915,922 ---- return; offsety = LASTLINE / 2 - Currentbuf->cursorY; if (offsety != 0) { ! /* Currentbuf->currentLine = lineSkip(Currentbuf, Currentbuf->currentLine,offsety, FALSE); */ ! Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->topLine, -offsety, FALSE); arrangeCursor(Currentbuf); displayBuffer(Currentbuf, B_NORMAL); } *************** *** 1526,1542 **** displayBuffer(Currentbuf, B_FORCE_REDRAW); return; } ! if (((*l == '^') || (*l == '$')) && prec_num) ! gotoLine(Currentbuf, prec_num); ! else if (*l == '^') { Currentbuf->topLine = Currentbuf->currentLine = Currentbuf->firstLine; } else if (*l == '$') { ! Currentbuf->topLine = lineSkip(Currentbuf->lastLine, -(LASTLINE + 1) / 2); Currentbuf->currentLine = Currentbuf->lastLine; } else ! gotoLine(Currentbuf, atoi(l)); arrangeCursor(Currentbuf); displayBuffer(Currentbuf, B_FORCE_REDRAW); } --- 1542,1558 ---- displayBuffer(Currentbuf, B_FORCE_REDRAW); return; } ! if (((*l == '^') || (*l == '$')) && prec_num) { ! gotoRealLine(Currentbuf, prec_num); ! } else if (*l == '^') { Currentbuf->topLine = Currentbuf->currentLine = Currentbuf->firstLine; } else if (*l == '$') { ! Currentbuf->topLine = lineSkip(Currentbuf, Currentbuf->lastLine, -(LASTLINE + 1) / 2, TRUE); Currentbuf->currentLine = Currentbuf->lastLine; } else ! gotoRealLine(Currentbuf, atoi(l)); arrangeCursor(Currentbuf); displayBuffer(Currentbuf, B_FORCE_REDRAW); } *************** *** 1891,1904 **** } /* frame page */ delBuffer(Currentbuf); Currentbuf = nfbuf; - /* save current frame combination */ - pushFrameTree(&(nfbuf->frameQ), copyFrameSet(nfbuf->frameset)); /* nfbuf->frameset = copyFrameSet(nfbuf->frameset); */ resetFrameElement(f_element, buf, referer, request); discardBuffer(buf); rFrame(); displayBuffer(Currentbuf, B_NORMAL); return buf; } --- 1907,1936 ---- } /* frame page */ + + /* stack current frameset */ + pushFrameTree(&(nfbuf->frameQ), + copyFrameSet(nfbuf->frameset), + Currentbuf->currentLine ? + Currentbuf->currentLine->linenumber : 0, + Currentbuf->pos); + /* delete frame view buffer */ delBuffer(Currentbuf); Currentbuf = nfbuf; /* nfbuf->frameset = copyFrameSet(nfbuf->frameset); */ resetFrameElement(f_element, buf, referer, request); discardBuffer(buf); rFrame(); + { + Anchor *al; + + al = searchURLLabel(Currentbuf, Strnew_m_charp("_", target, NULL)->ptr); + if (al) { + gotoLine(Currentbuf, al->start.line); + Currentbuf->pos = al->start.pos; + arrangeCursor(Currentbuf); + } + } displayBuffer(Currentbuf, B_NORMAL); return buf; } *************** *** 2141,2150 **** if (f2->type == FORM_INPUT_IMAGE) { *query = Strdup(f2->name); Strcat_charp(*query, ".x"); ! form_write_data(body, fi->parent->boundary, (*query)->ptr, "0"); *query = Strdup(f2->name); Strcat_charp(*query, ".y"); ! form_write_data(body, fi->parent->boundary, (*query)->ptr, "0"); } else if (f2->name && f2->name->length > 0) { #ifdef JP_CHARSET --- 2173,2182 ---- if (f2->type == FORM_INPUT_IMAGE) { *query = Strdup(f2->name); Strcat_charp(*query, ".x"); ! form_write_data(body, fi->parent->boundary, (*query)->ptr, "1"); *query = Strdup(f2->name); Strcat_charp(*query, ".y"); ! form_write_data(body, fi->parent->boundary, (*query)->ptr, "1"); } else if (f2->name && f2->name->length > 0) { #ifdef JP_CHARSET *************** *** 2164,2172 **** else { if (f2->type == FORM_INPUT_IMAGE) { Strcat(*query, f2->name); ! Strcat_charp(*query, ".x=0&"); Strcat(*query, f2->name); ! Strcat_charp(*query, ".y=0"); } else { if (f2->name && f2->name->length > 0) { --- 2196,2204 ---- else { if (f2->type == FORM_INPUT_IMAGE) { Strcat(*query, f2->name); ! Strcat_charp(*query, ".x=1&"); Strcat(*query, f2->name); ! Strcat_charp(*query, ".y=1"); } else { if (f2->name && f2->name->length > 0) { *************** *** 2619,2655 **** return TRUE; } - static void - realBackBuffer() - { - Buffer *buf; - - buf = Currentbuf->linkBuffer[LB_N_FRAME]; - delBuffer(Currentbuf); - if (RenderFrame && Currentbuf == buf) { - struct frameset *fs; - - fs = popFrameTree(&(buf->frameQ)); - if (fs == NULL) - realBackBuffer(); - else { - deleteFrameSet(buf->frameset); - buf->frameset = fs; - } - } - } - /* delete current buffer and back to the previous buffer */ void backBf(void) { if (!checkBackBuffer(Currentbuf)) { disp_message("Can't back...", TRUE); return; } ! realBackBuffer(); ! if (RenderFrame && Currentbuf->frameset != NULL) rFrame(); clear(); displayBuffer(Currentbuf, B_FORCE_REDRAW); } --- 2651,2688 ---- return TRUE; } /* delete current buffer and back to the previous buffer */ void backBf(void) { + Buffer *buf; + struct frameset *fs = NULL; + long linenumber; + short pos; + if (!checkBackBuffer(Currentbuf)) { disp_message("Can't back...", TRUE); return; } ! ! do { ! buf = Currentbuf->linkBuffer[LB_N_FRAME]; ! delBuffer(Currentbuf); ! } while (RenderFrame && ! Currentbuf == buf && ! (fs = popFrameTree(&(buf->frameQ), &linenumber, &pos)) == NULL); ! if (fs) { ! deleteFrameSet(buf->frameset); ! buf->frameset = fs; ! } ! ! if (RenderFrame && Currentbuf->frameset != NULL) { rFrame(); + gotoLine(Currentbuf, linenumber); + if (Currentbuf->currentLine) + Currentbuf->pos = MIN(pos, Currentbuf->currentLine->len - 1); + arrangeCursor(Currentbuf); + } clear(); displayBuffer(Currentbuf, B_FORCE_REDRAW); } *************** *** 3001,3013 **** void reload(void) { ! Buffer *buf, ! *fbuf = NULL; ! Str url; ! int linenum, ! is_source; ! FormList *request; ! int multipart; if (Currentbuf->bufferprop & BP_INTERNAL) { disp_message("Can't reload...", FALSE); --- 3034,3046 ---- void reload(void) { ! Buffer *buf, ! *fbuf = NULL; ! Str url; ! int linenum, ! is_source; ! FormList *request; ! int multipart; if (Currentbuf->bufferprop & BP_INTERNAL) { disp_message("Can't reload...", FALSE); *************** *** 3031,3037 **** } if (!(buf = renderFrame(fbuf))) return; ! delBuffer(fbuf->linkBuffer[LB_FRAME]); fbuf->linkBuffer[LB_FRAME] = buf; buf->linkBuffer[LB_N_FRAME] = fbuf; pushBuffer(buf); --- 3064,3077 ---- } if (!(buf = renderFrame(fbuf))) return; ! if (fbuf->linkBuffer[LB_FRAME]) { ! if (buf->sourcefile && ! fbuf->linkBuffer[LB_FRAME]->sourcefile && ! !strcmp(buf->sourcefile, ! fbuf->linkBuffer[LB_FRAME]->sourcefile)) ! fbuf->linkBuffer[LB_FRAME]->sourcefile = NULL; ! delBuffer(fbuf->linkBuffer[LB_FRAME]); ! } fbuf->linkBuffer[LB_FRAME] = buf; buf->linkBuffer[LB_N_FRAME] = fbuf; pushBuffer(buf); *************** *** 3244,3260 **** int cur = 0, all; if (Currentbuf->currentLine != NULL) ! cur = Currentbuf->currentLine->linenumber; ! all = Currentbuf->allLine; if (all == 0 && Currentbuf->lastLine != NULL) ! all = Currentbuf->lastLine->linenumber; if (all == 0) all = 1; #ifdef JP_CHARSET ! tmp = Sprintf("line %d/%d (%d%%) code %c", cur, all, cur * 100 / all, ! Currentbuf->document_code); #else /* not JP_CHARSET */ ! tmp = Sprintf("line %d/%d (%d%%)", cur, all, cur * 100 / all); #endif /* not JP_CHARSET */ disp_message(tmp->ptr, FALSE); --- 3284,3308 ---- int cur = 0, all; if (Currentbuf->currentLine != NULL) ! cur = Currentbuf->currentLine->real_linenumber; ! all = (Currentbuf->lastLine ? Currentbuf->lastLine->real_linenumber : Currentbuf->allLine); if (all == 0 && Currentbuf->lastLine != NULL) ! all = Currentbuf->currentLine->real_linenumber; if (all == 0) all = 1; #ifdef JP_CHARSET ! if (Currentbuf->pagerSource && strcmp(Currentbuf->buffername, CPIPEBUFFERNAME)) { ! tmp = Sprintf("line %d code %c", cur, Currentbuf->document_code); ! } else { ! tmp = Sprintf("line %d/%d (%d%%) code %c", cur, all, cur * 100 / all, ! Currentbuf->document_code); ! } #else /* not JP_CHARSET */ ! if (Currentbuf->pagerSource && strcmp(Currentbuf->buffername, CPIPEBUFFERNAME)) { ! tmp = Sprintf("line %d", cur); ! } else { ! tmp = Sprintf("line %d/%d (%d%%)", cur, all, cur * 100 / all); ! } #endif /* not JP_CHARSET */ disp_message(tmp->ptr, FALSE); *************** *** 3289,3323 **** delta_x = 0; if (abs(delta_y) < abs(delta_x) / 3) delta_y = 0; ! if (delta_y > 0) { prec_num = delta_y; ! if (reverse_mouse) ! lup1(); ! else ! ldown1(); } else if (delta_y < 0) { prec_num = -delta_y; ! if (reverse_mouse) ! ldown1(); ! else ! lup1(); } - if (delta_x > 0) { ! for (i = 0; i < delta_x; i++) ! if (reverse_mouse) ! col1R(); ! else ! col1L(); } else if (delta_x < 0) { ! for (i = 0; i < -delta_x; i++) ! if (reverse_mouse) ! col1L(); ! else ! col1R(); } } else { --- 3337,3361 ---- delta_x = 0; if (abs(delta_y) < abs(delta_x) / 3) delta_y = 0; ! if (reverse_mouse) { ! delta_y = -delta_y; ! delta_x = -delta_x; ! } if (delta_y > 0) { prec_num = delta_y; ! ldown1(); } else if (delta_y < 0) { prec_num = -delta_y; ! lup1(); } if (delta_x > 0) { ! prec_num = delta_x; ! col1L(); } else if (delta_x < 0) { ! prec_num = -delta_x; ! col1R(); } } else { diff -c w3m/proto.h w3m-0.1.10-pre+666/proto.h *** w3m/proto.h Wed May 17 18:04:19 2000 --- w3m-0.1.10-pre+666/proto.h Tue May 23 18:24:42 2000 *************** *** 149,154 **** --- 149,155 ---- extern Buffer *namedBuffer(Buffer * first, char *name); extern Buffer *deleteBuffer(Buffer * first, Buffer * delbuf); extern Buffer *replaceBuffer(Buffer * first, Buffer * delbuf, Buffer * newbuf); + extern void gotoRealLine(Buffer * buf, int n); extern void gotoLine(Buffer * buf, int n); extern Buffer *selectBuffer(Buffer * firstbuf, Buffer * currentbuf, char *selectchar); extern void reshapeBuffer(Buffer * buf); *************** *** 184,190 **** extern int bpcmp(BufferPoint p1, BufferPoint p2); extern int columnSkip(Buffer * buf, int offset); extern int columnPos(Line * line, int column); ! extern Line *lineSkip(Line * line, int offset); extern int gethtmlcmd(char **s, int *status); extern char *getAnchor(char *arg, char **arg_return); extern Str checkType(char *istr, Lineprop * oprop, int len); --- 185,191 ---- extern int bpcmp(BufferPoint p1, BufferPoint p2); extern int columnSkip(Buffer * buf, int offset); extern int columnPos(Line * line, int column); ! extern Line *lineSkip(Buffer * buf, Line * line, int offset, int last); extern int gethtmlcmd(char **s, int *status); extern char *getAnchor(char *arg, char **arg_return); extern Str checkType(char *istr, Lineprop * oprop, int len); *************** *** 236,241 **** --- 237,243 ---- extern char *form2str(FormItemList * fi); extern int formtype(char *typestr); extern void form_recheck_radio(FormItemList * fi, void *data, void (*update_hook) (FormItemList *, void *)); + extern void formResetBuffer(Buffer * buf, AnchorList * formitem); extern void formUpdateBuffer(Anchor * a, Buffer * buf, FormItemList * form); extern Str textfieldrep(Str s, int width); extern void input_textarea(FormItemList * fi); *************** *** 245,259 **** extern void follow_map(struct parsed_tagarg *arg); extern Buffer *follow_map_panel(Buffer * buf, struct parsed_tagarg *arg); extern Buffer *page_info_panel(Buffer * buf); extern struct frameset *newFrameSet(struct parsed_tagarg *arg); ! extern void addFrame(struct frameset *f, struct parsed_tagarg *arg, ParsedURL *baseURL); ! extern void addFrameSet(struct frameset *f, struct frameset *fset); extern void deleteFrame(struct frame_body *b); extern void deleteFrameSet(struct frameset *f); extern void deleteFrameSetElement(union frameset_element e); extern struct frameset *copyFrameSet(struct frameset *of); ! extern void pushFrameTree(struct frameset_queue **fqpp, struct frameset *fs); ! extern struct frameset *popFrameTree(struct frameset_queue **fqpp); extern void resetFrameElement(union frameset_element *f_element, Buffer * buf, char *referer, FormList * request); extern Buffer *renderFrame(Buffer * Cbuf); extern union frameset_element *search_frame(struct frameset *fset, char *name); --- 247,261 ---- extern void follow_map(struct parsed_tagarg *arg); extern Buffer *follow_map_panel(Buffer * buf, struct parsed_tagarg *arg); extern Buffer *page_info_panel(Buffer * buf); + extern struct frame_body *newFrame(struct parsed_tagarg *arg, ParsedURL *baseURL); extern struct frameset *newFrameSet(struct parsed_tagarg *arg); ! extern void addFrameSetElement(struct frameset *f, union frameset_element element); extern void deleteFrame(struct frame_body *b); extern void deleteFrameSet(struct frameset *f); extern void deleteFrameSetElement(union frameset_element e); extern struct frameset *copyFrameSet(struct frameset *of); ! extern void pushFrameTree(struct frameset_queue **fqpp, struct frameset *fs, long linenumber, short pos); ! extern struct frameset *popFrameTree(struct frameset_queue **fqpp, long *linenumber, short *pos); extern void resetFrameElement(union frameset_element *f_element, Buffer * buf, char *referer, FormList * request); extern Buffer *renderFrame(Buffer * Cbuf); extern union frameset_element *search_frame(struct frameset *fset, char *name); *************** *** 293,299 **** #endif /* COLOR */ extern void refresh(void); extern void clear(void); - extern void scroll_raw(void); extern void scroll(int); extern void rscroll(int); extern void need_clrtoeol(void); --- 295,300 ---- diff -c w3m/rc.c w3m-0.1.10-pre+666/rc.c *** w3m/rc.c Wed May 17 17:10:28 2000 --- w3m-0.1.10-pre+666/rc.c Tue May 23 18:24:08 2000 *************** *** 15,20 **** --- 15,24 ---- #include + #ifndef min + #define min(a,b) ((a) > (b) ? (b) : (a)) + #endif /* not min */ + struct param_ptr { char *name; int type; *************** *** 432,511 **** struct param_ptr * search_param(char *name) { ! size_t b, e, i; ! int cmp; ! int len = strlen(name); ! ! for (b = 0, e = RC_table_size-1 ; b <= e ;) { ! i = (b + e) / 2; ! cmp = strncmp(name, RC_search_table[i].param->name,len); ! ! if (!cmp) { ! if (len >= RC_search_table[i].uniq_pos) { ! return RC_search_table[i].param; } ! else { ! /* ambiguous */ ! return NULL; } } ! else if (cmp < 0) ! e = i - 1; ! else ! b = i + 1; ! } ! return NULL; } #ifdef SHOW_PARAMS void show_params(FILE *fp) { ! int i,j; ! char *t; ! char *cmt; ! ! fputs("\nconfiguration parameters\n", fp); ! for (j = 0; sections[j].name != NULL; j++) { ! fprintf(fp, " section[%d]: %s\n", j, sections[j].name); ! i = 0; ! while (sections[j].params[i].name) { ! switch(sections[j].params[i].type) { ! case P_INT: ! case P_SHORT: ! case P_CHARINT: ! t = (sections[j].params[i].inputtype == PI_ONOFF) ? "bool" : "number"; ! break; ! case P_CHAR: ! t = "E|S|j|N|m|n"; /* only kanjicode */ ! break; ! case P_STRING: ! t = "string"; ! break; #if defined(USE_SSL) && defined(USE_SSL_VERIFY) ! case P_SSLPATH: ! t = "path"; ! break; #endif #ifdef COLOR ! case P_COLOR: ! t = "color"; ! break; #endif ! } #ifdef JP_CHARSET ! if (InnerCode != DisplayCode) ! cmt = conv(sections[j].params[i].comment,InnerCode,DisplayCode)->ptr; ! else ! cmt = sections[j].params[i].comment; ! #else /* not JP_CHARSET */ ! cmt = sections[j].params[i].comment; ! #endif /* not JP_CHARSET */ ! fprintf(fp, " -o %s=<%s>\t\t%s\n", ! sections[j].params[i].name, t, cmt); ! i++; } - } } #endif --- 436,532 ---- struct param_ptr * search_param(char *name) { ! size_t b, e, i; ! int cmp; ! int len = strlen(name); ! ! for (b = 0, e = RC_table_size-1 ; b <= e ;) { ! i = (b + e) / 2; ! cmp = strncmp(name, RC_search_table[i].param->name,len); ! ! if (!cmp) { ! if (len >= RC_search_table[i].uniq_pos) { ! return RC_search_table[i].param; ! } ! else { ! while ((cmp = strcmp(name, RC_search_table[i].param->name)) <= 0) ! if (!cmp) ! return RC_search_table[i].param; ! else ! i--; ! /* ambiguous */ ! return NULL; ! } } ! else if (cmp < 0) { ! if (i == 0) ! return NULL; ! e = i - 1; } + else + b = i + 1; } ! return NULL; } #ifdef SHOW_PARAMS void show_params(FILE *fp) { ! int i, j, l; ! char *t; ! char *cmt; ! ! fputs("\nconfiguration parameters\n", fp); ! for (j = 0; sections[j].name != NULL; j++) { ! #ifdef JP_CHARSET ! if (InnerCode != DisplayCode) ! cmt = conv(sections[j].name, InnerCode, DisplayCode)->ptr; ! else ! #endif /* JP_CHARSET */ ! cmt = sections[j].name; ! fprintf(fp, " section[%d]: %s\n", j, cmt); ! i = 0; ! while (sections[j].params[i].name) { ! switch(sections[j].params[i].type) { ! case P_INT: ! case P_SHORT: ! case P_CHARINT: ! t = (sections[j].params[i].inputtype == PI_ONOFF) ? "bool" : "number"; ! break; ! case P_CHAR: ! t = "E|S|j|N|m|n"; /* only kanjicode */ ! break; ! case P_STRING: ! t = "string"; ! break; #if defined(USE_SSL) && defined(USE_SSL_VERIFY) ! case P_SSLPATH: ! t = "path"; ! break; #endif #ifdef COLOR ! case P_COLOR: ! t = "color"; ! break; #endif ! } #ifdef JP_CHARSET ! if (InnerCode != DisplayCode) ! cmt = conv(sections[j].params[i].comment, ! InnerCode, ! DisplayCode)->ptr; ! else ! #endif /* JP_CHARSET */ ! cmt = sections[j].params[i].comment; ! l = 30 - (strlen(sections[j].params[i].name) + strlen(t)); ! if (l < 0) ! l = 1; ! fprintf(fp, " -o %s=<%s>%*s%s\n", ! sections[j].params[i].name, t, l, " ", cmt); ! i++; ! } } } #endif Common subdirectories: w3m/scripts and w3m-0.1.10-pre+666/scripts diff -c w3m/table.c w3m-0.1.10-pre+666/table.c *** w3m/table.c Wed May 17 18:04:19 2000 --- w3m-0.1.10-pre+666/table.c Tue May 23 18:10:45 2000 *************** *** 318,324 **** t->suspended_input = Strnew(); t->caption = Strnew(); #ifdef ID_EXT ! t->id = Strnew(); #endif return t; } --- 318,324 ---- t->suspended_input = Strnew(); t->caption = Strnew(); #ifdef ID_EXT ! t->id = NULL; #endif return t; } *************** *** 704,712 **** forbid |= 1; } } ! if (forbid != 15) /* forbid==15 means 'no * * * rule at all' ! * ! * * */ Strcat_charp(buf, rulep[forbid]); } } --- 704,710 ---- forbid |= 1; } } ! if (forbid != 15) /* forbid==15 means 'no rule at all' */ Strcat_charp(buf, rulep[forbid]); } } *************** *** 1630,1636 **** HTMLlineproc1("
", h_env);
  #ifdef ID_EXT
      if (t->id != NULL) {
! 	idtag = Sprintf("", (t->id)->ptr);
  	HTMLlineproc1(idtag->ptr, h_env);
      }
  #endif		/* ID_EXT */
--- 1628,1634 ----
      HTMLlineproc1("
", h_env);
  #ifdef ID_EXT
      if (t->id != NULL) {
! 	idtag = Sprintf("<_id id=\"%s\">", (t->id)->ptr);
  	HTMLlineproc1(idtag->ptr, h_env);
      }
  #endif		/* ID_EXT */
***************
*** 1673,1679 ****
  		Strcat(renderbuf, vrulea);
  #ifdef ID_EXT
  	    if (t->tridvalue[r] != NULL && h == 0) {
! 		idtag = Sprintf("", (t->tridvalue[r])->ptr);
  		Strcat(renderbuf, idtag);
  	    }
  #endif				/* ID_EXT */
--- 1671,1677 ----
  		Strcat(renderbuf, vrulea);
  #ifdef ID_EXT
  	    if (t->tridvalue[r] != NULL && h == 0) {
! 		idtag = Sprintf("<_id id=\"%s\">", (t->tridvalue[r])->ptr);
  		Strcat(renderbuf, idtag);
  	    }
  #endif				/* ID_EXT */
***************
*** 1681,1687 ****
  		check_row(t, r);
  #ifdef ID_EXT
  		if (t->tabidvalue[r][i] != NULL && h == 0) {
! 		    idtag = Sprintf("", (t->tabidvalue[r][i])->ptr);
  		    Strcat(renderbuf, idtag);
  		}
  #endif				/* ID_EXT */
--- 1679,1685 ----
  		check_row(t, r);
  #ifdef ID_EXT
  		if (t->tabidvalue[r][i] != NULL && h == 0) {
! 		    idtag = Sprintf("<_id id=\"%s\">", (t->tabidvalue[r][i])->ptr);
  		    Strcat(renderbuf, idtag);
  		}
  #endif				/* ID_EXT */
***************
*** 2016,2023 ****
      cmd = gethtmlcmd(&s_line, &status);
  
  #ifdef MENU_SELECT
!     /* failsafe: a tag other than and  in * * *
!      * * * . */
      if ((mode->pre_mode & TBLM_INSELECT) &&
  	cmd != HTML_OPTION &&
  	cmd != HTML_N_OPTION &&
--- 2014,2021 ----
      cmd = gethtmlcmd(&s_line, &status);
  
  #ifdef MENU_SELECT
!     /* failsafe: a tag other than and  in
!      * . */
      if ((mode->pre_mode & TBLM_INSELECT) &&
  	cmd != HTML_OPTION &&
  	cmd != HTML_N_OPTION &&
***************
*** 2123,2138 ****
  	    }
  	    else if (!strcasecmp(t->arg, "colspan") && t->value) {
  		colspan = atoi(t->value);
! 		if ((tbl->col + colspan) >= MAXCOL)
! 		    colspan = MAXCOL - tbl->col;	/* Can't  *  * *
! 							 * * *  * *  * *
! 							 * *  *  * * * *
! 							 * * expand  *  *
! 							 * * * *  *  * * * 
! 							 * * *  *  * *  *
! 							 * *  * column  * 
! 							 * * *  * *  * *  * 
! 							 */
  	    }
  	    else if (!strcasecmp(t->arg, "align") && t->value) {
  		if (!strcasecmp(t->value, "left"))
--- 2121,2130 ----
  	    }
  	    else if (!strcasecmp(t->arg, "colspan") && t->value) {
  		colspan = atoi(t->value);
! 		if ((tbl->col + colspan) >= MAXCOL) {
! 		    /* Can't expand column */
! 		    colspan = MAXCOL - tbl->col;
! 		}
  	    }
  	    else if (!strcasecmp(t->arg, "align") && t->value) {
  		if (!strcasecmp(t->value, "left"))
***************
*** 2402,2409 ****
  	if (tmp)
  	    feed_table(tbl, tmp->ptr, mode, width);
  #ifdef MENU_SELECT
! 	if (!tag_exists(t_arg, "multiple"))	/* non-multiple * * * * *
! 						 * select */
  	    mode->pre_mode |= TBLM_INSELECT;
  #endif				/* MENU_SELECT */
  	break;
--- 2394,2400 ----
  	if (tmp)
  	    feed_table(tbl, tmp->ptr, mode, width);
  #ifdef MENU_SELECT
! 	if (!tag_exists(t_arg, "multiple"))	/* non-multiple select */
  	    mode->pre_mode |= TBLM_INSELECT;
  #endif				/* MENU_SELECT */
  	break;
***************
*** 2603,2609 ****
  			q = p;
  			r = getescapecmd(&p);
  			if (r != NULL && ((*r & 0x80) || IS_CNTRL(*r))) {
! 			    /* latin-1 * * * character */
  			    Strcat_charp(tmp, r);
  			}
  			else {
--- 2594,2600 ----
  			q = p;
  			r = getescapecmd(&p);
  			if (r != NULL && ((*r & 0x80) || IS_CNTRL(*r))) {
! 			    /* latin-1 character */
  			    Strcat_charp(tmp, r);
  			}
  			else {
***************
*** 2633,2639 ****
  	    if (mode->pre_mode & TBLM_NOBR && mode->nobr_offset < 0)
  		mode->nobr_offset = tbl->tabcontentssize;
  
! 	    /* count of number of spaces skipped in normal * *  * mode */
  	    i = skip_space(tbl, line, linfo, !(mode->pre_mode & TBLM_NOBR));
  	    addcontentssize(tbl, visible_length(line) - i);
  	    setwidth(tbl, mode);
--- 2624,2630 ----
  	    if (mode->pre_mode & TBLM_NOBR && mode->nobr_offset < 0)
  		mode->nobr_offset = tbl->tabcontentssize;
  
! 	    /* count of number of spaces skipped in normal mode */
  	    i = skip_space(tbl, line, linfo, !(mode->pre_mode & TBLM_NOBR));
  	    addcontentssize(tbl, visible_length(line) - i);
  	    setwidth(tbl, mode);
diff -c w3m/tagtable.c w3m-0.1.10-pre+666/tagtable.c
*** w3m/tagtable.c	Wed May 17 18:02:40 2000
--- w3m-0.1.10-pre+666/tagtable.c	Tue May 23 20:09:30 2000
***************
*** 136,154 ****
    /* 131 */ {"/code",HTML_NOP,NULL},
    /* 132 */ {"/thead",HTML_N_THEAD,&MyHashItem[133]},
    /* 133 */ {"/samp",HTML_NOP,&MyHashItem[134]},
!   /* 134 */ {"/dfn",HTML_NOP,NULL},
!   /* 135 */ {"/strike",HTML_N_DEL,&MyHashItem[136]},
!   /* 136 */ {"/a",HTML_N_A,NULL},
!   /* 137 */ {"/b",HTML_N_B,NULL},
!   /* 138 */ {"font",HTML_FONT,&MyHashItem[139]},
!   /* 139 */ {"/dl",HTML_N_DL,NULL},
!   /* 140 */ {"form",HTML_FORM,&MyHashItem[141]},
!   /* 141 */ {"/cite",HTML_NOP,&MyHashItem[142]},
!   /* 142 */ {"a",HTML_A,NULL},
!   /* 143 */ {"b",HTML_B,NULL},
!   /* 144 */ {"/listing",HTML_N_LISTING,&MyHashItem[145]},
!   /* 145 */ {"/em",HTML_N_EM,&MyHashItem[146]},
!   /* 146 */ {"/i",HTML_NOP,NULL},
  };
  
  static HashItem_si *MyHashItemTbl[] = {
--- 136,155 ----
    /* 131 */ {"/code",HTML_NOP,NULL},
    /* 132 */ {"/thead",HTML_N_THEAD,&MyHashItem[133]},
    /* 133 */ {"/samp",HTML_NOP,&MyHashItem[134]},
!   /* 134 */ {"/dfn",HTML_NOP,&MyHashItem[135]},
!   /* 135 */ {"_id",HTML_NOP,NULL},
!   /* 136 */ {"/strike",HTML_N_DEL,&MyHashItem[137]},
!   /* 137 */ {"/a",HTML_N_A,NULL},
!   /* 138 */ {"/b",HTML_N_B,NULL},
!   /* 139 */ {"font",HTML_FONT,&MyHashItem[140]},
!   /* 140 */ {"/dl",HTML_N_DL,NULL},
!   /* 141 */ {"form",HTML_FORM,&MyHashItem[142]},
!   /* 142 */ {"/cite",HTML_NOP,&MyHashItem[143]},
!   /* 143 */ {"a",HTML_A,NULL},
!   /* 144 */ {"b",HTML_B,NULL},
!   /* 145 */ {"/listing",HTML_N_LISTING,&MyHashItem[146]},
!   /* 146 */ {"/em",HTML_N_EM,&MyHashItem[147]},
!   /* 147 */ {"/i",HTML_NOP,NULL},
  };
  
  static HashItem_si *MyHashItemTbl[] = {
***************
*** 243,257 ****
    NULL,
    &MyHashItem[131],
    &MyHashItem[132],
!   &MyHashItem[135],
!   &MyHashItem[137],
    NULL,
    NULL,
    NULL,
!   &MyHashItem[138],
!   &MyHashItem[140],
!   &MyHashItem[143],
    &MyHashItem[144],
  };
  
  Hash_si tagtable = {100, MyHashItemTbl};
--- 244,258 ----
    NULL,
    &MyHashItem[131],
    &MyHashItem[132],
!   &MyHashItem[136],
!   &MyHashItem[138],
    NULL,
    NULL,
    NULL,
!   &MyHashItem[139],
!   &MyHashItem[141],
    &MyHashItem[144],
+   &MyHashItem[145],
  };
  
  Hash_si tagtable = {100, MyHashItemTbl};
diff -c w3m/tagtable.tab w3m-0.1.10-pre+666/tagtable.tab
*** w3m/tagtable.tab	Thu Apr  6 14:18:54 2000
--- w3m-0.1.10-pre+666/tagtable.tab	Tue May 23 18:10:45 2000
***************
*** 3,8 ****
--- 3,9 ----
  %%
  a		HTML_A
  /a		HTML_N_A
+ _id		HTML_NOP
  hr		HTML_HR
  h1		HTML_H
  h2		HTML_H
diff -c w3m/terms.c w3m-0.1.10-pre+666/terms.c
*** w3m/terms.c	Wed May 17 18:04:19 2000
--- w3m-0.1.10-pre+666/terms.c	Tue May 23 18:10:45 2000
***************
*** 1205,1211 ****
      CurrentMode = C_ASCII;
  }
  
! void
  scroll_raw(void)
  {				/* raw scroll */
      MOVE(LINES - 1, 0);
--- 1205,1211 ----
      CurrentMode = C_ASCII;
  }
  
! static void
  scroll_raw(void)
  {				/* raw scroll */
      MOVE(LINES - 1, 0);
***************
*** 1712,1726 ****
  void
  mouse_init()
  {
-     char           *term;
      Gpm_Connect     conn;
      extern int      gpm_process_mouse(Gpm_Event *, void *);
  
      if (mouseActive)
  	return;
!     term = getenv("TERM");
!     if (!strncmp(term, "kterm", 5) || !strncmp(term, "xterm", 5)) {
! 	is_xterm = 1;
      }
      else {
  	conn.eventMask = ~0;
--- 1712,1724 ----
  void
  mouse_init()
  {
      Gpm_Connect     conn;
      extern int      gpm_process_mouse(Gpm_Event *, void *);
  
      if (mouseActive)
  	return;
!     if (is_xterm) {
!        XTERM_ON;
      }
      else {
  	conn.eventMask = ~0;
***************
*** 1746,1765 ****
      mouseActive = 0;
  }
  
! #elif USE_SYSMOUSE
  /* *BSD console with sysmouse support */
  void
  mouse_init()
  {
-     char           *term;
      mouse_info_t    mi;
      extern int      sysm_process_mouse();
  
      if (mouseActive)
  	return;
!     term = getenv("TERM");
!     if (!strncmp(term, "kterm", 5) || !strncmp(term, "xterm", 5)) {
! 	is_xterm = 1;
      }
      else {
  #if defined(FBIO_MODEINFO) || defined(CONS_MODEINFO)	/* FreeBSD > 2.x */
--- 1744,1761 ----
      mouseActive = 0;
  }
  
! #elif	defined(USE_SYSMOUSE)
  /* *BSD console with sysmouse support */
  void
  mouse_init()
  {
      mouse_info_t    mi;
      extern int      sysm_process_mouse();
  
      if (mouseActive)
  	return;
!     if (is_xterm) {
!        XTERM_ON;
      }
      else {
  #if defined(FBIO_MODEINFO) || defined(CONS_MODEINFO)	/* FreeBSD > 2.x */
***************
*** 1813,1823 ****
  void
  mouse_init()
  {
!     char           *term;
! 
!     term = getenv("TERM");
!     if (!strncmp(term, "kterm", 5) || !strncmp(term, "xterm", 5)) {
! 	is_xterm = 1;
      }
      mouseActive = 1;
  }
--- 1809,1818 ----
  void
  mouse_init()
  {
!     if (mouseActive)
!        return;
!     if (is_xterm) {
!        XTERM_ON;
      }
      mouseActive = 1;
  }