diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/Str.c w3m-0.1.11-pre-kokb20/Str.c --- w3m-0.1.11-pre/Str.c Tue Jun 6 14:39:13 2000 +++ w3m-0.1.11-pre-kokb20/Str.c Wed Nov 22 06:07:07 2000 @@ -1,4 +1,4 @@ -/* $Id: Str.c,v 1.9 2000/06/06 05:39:13 aito Exp $ */ +/* $Id: Str.c,v 1.1.1.1.4.2 2000/11/21 21:07:07 okabe Exp $ */ /* * String manipulation library for Boehm GC * @@ -87,13 +87,9 @@ Strnew_charp_n(char *p, int n) { Str x = GC_MALLOC(sizeof(struct _Str)); - int len; if (p == NULL) return Strnew_size(n); - len = strlen(p); - if (len < n) - n = len; x->ptr = GC_MALLOC_ATOMIC(n + 1); x->area_size = n + 1; x->length = n; @@ -176,9 +172,6 @@ } strncpy(x->ptr, y, n); x->ptr[n] = '\0'; - len = strlen(y); - if (len < n) - n = len; x->length = n; } @@ -543,14 +536,6 @@ break; } return s; -} - -void -Strfputs(Str s, FILE * f) -{ - int i; - for (i = 0; i < s->length; i++) - putc(s->ptr[i], f); } Str diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/Str.h w3m-0.1.11-pre-kokb20/Str.h --- w3m-0.1.11-pre/Str.h Tue Jun 6 14:39:13 2000 +++ w3m-0.1.11-pre-kokb20/Str.h Mon Oct 30 04:55:18 2000 @@ -1,4 +1,4 @@ -/* $Id: Str.h,v 1.8 2000/06/06 05:39:13 aito Exp $ */ +/* $Id: Str.h,v 1.1.1.1.4.1 2000/10/29 19:55:18 okabe Exp $ */ /* * String manipulation library for Boehm GC * @@ -80,4 +80,5 @@ #define Strlastchar(s) ((s)->length>0?(s)->ptr[(s)->length-1]:'\0') #define Strinsert(s,n,p) Strinsert_charp(s,n,(p)->ptr) #define Strshrinkfirst(s,n) Strdelete(s,0,n) +#define Strfputs(s,f) fwrite((s)->ptr,1,(s)->length,(f)) #endif /* not GC_STR_H */ diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/XMakefile w3m-0.1.11-pre-kokb20/XMakefile --- w3m-0.1.11-pre/XMakefile Tue Jun 6 14:39:13 2000 +++ w3m-0.1.11-pre-kokb20/XMakefile Wed Nov 22 06:07:08 2000 @@ -4,8 +4,8 @@ OBJS=main.o file.o buffer.o display.o etc.o search.o linein.o table.o local.o\ form.o map.o frame.o rc.o menu.o mailcap.o\ func.o cookie.o history.o $(KEYBIND_OBJ) -LSRCS=terms.c conv.c url.c ftp.c anchor.c mimehead.c hash.c tagtable.c -LOBJS=terms.o conv.o url.o ftp.o anchor.o mimehead.o hash.o tagtable.o +LSRCS=terms.c conv.c url.c ftp.c anchor.c mimehead.c hash.c tagtable.c istream.c +LOBJS=terms.o conv.o url.o ftp.o anchor.o mimehead.o hash.o tagtable.o istream.o LLOBJS=version.o ALIBOBJS=Str.o indep.o regex.o textlist.o parsetag.o ALIB=libindep.a diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/anchor.c w3m-0.1.11-pre-kokb20/anchor.c --- w3m-0.1.11-pre/anchor.c Tue Jun 6 14:39:13 2000 +++ w3m-0.1.11-pre-kokb20/anchor.c Sun Nov 19 05:02:55 2000 @@ -1,5 +1,4 @@ -/* Marker extension by okabe */ -/* $Id: anchor.c,v 1.9 2000/06/06 05:39:13 aito Exp $ */ +/* $Id: anchor.c,v 1.2.2.1 2000/11/18 20:02:55 okabe Exp $ */ #ifdef __EMX__ #include #endif @@ -193,6 +192,7 @@ return searchAnchor(buf->name, url); } +#ifdef USE_NNTP static Anchor * _put_anchor_news(Buffer * buf, char *p1, char *p2, int line, int pos) { @@ -206,6 +206,7 @@ } return registerHref(buf, tmp->ptr, NULL, NO_REFERER, line, pos); } +#endif /* USE_GOPHER */ static Anchor * _put_anchor_all(Buffer * buf, char *p1, char *p2, int line, int pos) @@ -335,11 +336,13 @@ return reAnchorAny(buf, re, _put_anchor_all); } +#ifdef USE_NNTP char * reAnchorNews(Buffer * buf, char *re) { return reAnchorAny(buf, re, _put_anchor_news); } +#endif /* USE_NNTP */ #define FIRST_MARKER_SIZE 30 HmarkerList * diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/buffer.c w3m-0.1.11-pre-kokb20/buffer.c --- w3m-0.1.11-pre/buffer.c Wed Jun 14 19:26:34 2000 +++ w3m-0.1.11-pre-kokb20/buffer.c Wed Nov 22 06:07:08 2000 @@ -83,14 +83,12 @@ continue; b->linkBuffer[REV_LB[i]] = NULL; } + if (buf->savecache) + unlink(buf->savecache); if (--(*buf->clone)) return; - if (buf->pagerSource) { - if (buf->bufferprop & BP_PIPE) - pclose(buf->pagerSource); - else - fclose(buf->pagerSource); - } + if (buf->pagerSource) + ISclose(buf->pagerSource); if (buf->sourcefile) { if (buf->real_scheme != SCM_LOCAL || buf->bufferprop & BP_FRAME) unlink(buf->sourcefile); @@ -99,8 +97,6 @@ deleteFrameSet(buf->frameset); buf->frameset = popFrameTree(&(buf->frameQ), NULL, NULL); } - if (buf->savecache) - unlink(buf->savecache); } /* @@ -170,7 +166,7 @@ return newbuf; } -static Buffer * +Buffer * nthBuffer(Buffer * firstbuf, int n) { int i; @@ -230,7 +226,7 @@ if (l == NULL) return; - if (buf->pagerSource && strcmp(buf->buffername, CPIPEBUFFERNAME)) { + if (buf->pagerSource && !(buf->bufferprop & BP_CLOSE)) { if (buf->lastLine->linenumber < n) getNextPage(buf, n - buf->lastLine->linenumber); while ((buf->lastLine->linenumber < n) && @@ -271,7 +267,7 @@ if (l == NULL) return; - if (buf->pagerSource && strcmp(buf->buffername, CPIPEBUFFERNAME)) { + if (buf->pagerSource && !(buf->bufferprop & BP_CLOSE)) { if (buf->lastLine->real_linenumber < n) getNextPage(buf, n - buf->lastLine->real_linenumber); while ((buf->lastLine->real_linenumber < n) && @@ -486,13 +482,10 @@ int linenum; AnchorList *formitem; - f.stream.f = examineFile(buf->sourcefile, &f.close); - if (f.stream.f == NULL) + init_stream(&f, SCM_LOCAL, NULL); + examineFile(buf->sourcefile, &f); + if (f.stream == NULL) return; - f.stream_type = SMT_FILE; - f.iseof = FALSE; - f.encoding = ENC_7BIT; - f.scheme = SCM_LOCAL; if (buf->firstLine == NULL) linenum = 1; @@ -533,6 +526,7 @@ void copyBuffer(Buffer * a, Buffer * b) { + readBufferCache(b); bcopy((void *) b, (void *) a, sizeof(Buffer)); } @@ -555,13 +549,14 @@ FILE *cache = NULL; Line *l; + if (buf->savecache) + return -1; + if (buf->firstLine == NULL) goto _error1; - if (!buf->savecache) { - tmp = Sprintf("%s/w3mcache%d.%lx", rc_dir, getpid(), (unsigned long) buf); - buf->savecache = tmp->ptr; - } + tmp = tmpfname(TMPF_CACHE, NULL); + buf->savecache = tmp->ptr; cache = fopen(buf->savecache, "w"); if (!cache) goto _error1; @@ -585,7 +580,7 @@ fclose(cache); unlink(buf->savecache); _error1: - buf->savecache == NULL; + buf->savecache = NULL; return -1; } diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/configure w3m-0.1.11-pre-kokb20/configure --- w3m-0.1.11-pre/configure Wed Jun 14 13:28:32 2000 +++ w3m-0.1.11-pre-kokb20/configure Sun Nov 19 15:36:15 2000 @@ -263,8 +263,10 @@ special_sys="#define AIX" ;; CYGWIN ) - special_sys="#define CYGWIN" + special_sys="#define CYGWIN $sysversion1" + if [ $sysversion1 -eq 0 ]; then topdir=/cygnus/cygwin-b20/H-i586-cygwin32 + fi ;; NetBSD ) # Newer NetBSD system doesn't define 'unix' symbol anymore, but GC library @@ -576,7 +578,7 @@ fi echo "Do you want to use SSL?" -echo '(You need openSSL library; Please see http://www.openssl.org/)' +echo '(You need OpenSSL library; Please see http://www.openssl.org/)' yesno use_ssl "$use_ssl" n echo "use_ssl=$use_ssl" >> config.param if [ "$use_ssl" = y ]; then @@ -592,6 +594,7 @@ if [ "$use_ssl" = y ]; then echo "Do you want SSL verification support" + echo '(Your SSL library must be version 0.8 or later)' yesno use_ssl_verify "$use_ssl_verify" n echo "use_ssl_verify=$use_ssl_verify" >> config.param if [ "$use_ssl_verify" = y ]; then @@ -823,7 +826,7 @@ if [ "$ans" = 'n' -o "$ans" = 'N' ]; then cflags="$cflags -I$gcinclude" else - cflags="$cflags -I./gc" + cflags="$cflags -I./gc/include" gclib="gc/gc.a" gctarget=$gclib fi @@ -832,12 +835,12 @@ fi else echo "but it doesn't seem to work." - cflags="$cflags -I./gc" + cflags="$cflags -I./gc/include" gclib="gc/gc.a" gctarget=$gclib fi else - cflags="$cflags -I./gc" + cflags="$cflags -I./gc/include" gclib="gc/gc.a" gctarget="$gclib" fi @@ -1407,10 +1410,13 @@ done if [ "X$v6lib" = "X" ]; then echo "You don't have getaddrinfo()." - ipv6 = "#undef INET6" + ipv6="#undef INET6" fi fi ;; + CYGWIN*) + ipv6="#undef INET6" + ;; esac fi if [ "$ipv6" = "#undef INET6" ]; then @@ -1522,6 +1528,21 @@ */ #define BUFINFO +/* + * Support EGD (Entropy Gathering Daemon) + */ +#undef USE_EGD + +/* + * MENU_MAP enables w3m to show image map link with popup menu. + */ +#undef MENU_MAP + +/* + * Use Emacs-like key binding for file name completion + */ +#undef EMACS_LIKE_LINEEDIT + /**********************************************************/ #ifdef makefile_parameter @@ -1620,6 +1641,7 @@ $ipv6 #undef TABLE_EXPAND +#undef TABLE_NO_COMPACT #define NOWRAP 1 #define NEW_FORM 1 #define MATRIX 1 diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/conv.c w3m-0.1.11-pre-kokb20/conv.c --- w3m-0.1.11-pre/conv.c Tue Jun 6 14:39:13 2000 +++ w3m-0.1.11-pre-kokb20/conv.c Wed Nov 22 06:07:08 2000 @@ -3,6 +3,7 @@ #include "fm.h" #ifdef JP_CHARSET +#include "terms.h" #include "Str.h" #ifdef DEBUG @@ -10,6 +11,8 @@ #endif /* DEBUG */ #define uchar unsigned char +#define ushort unsigned short +#define uint unsigned int #ifdef TRUE #undef TRUE @@ -50,8 +53,6 @@ #define CSET_X0201K 2 #define CSET_UNKNOWN 3 -#define CODES 7 /* Number of supported Kanji code */ - #define JSIcode "\033$@" #define JSOcode "\033(H" #define J2SIcode "\033$@" @@ -67,12 +68,12 @@ static char *SIcode, *SOcode; -static Str cConvEE(char *is); -static Str cConvEJ(char *is); -static Str cConvES(char *is); -static Str cConvSE(char *is); -static Str cConvJE(char *is); -char checkShiftCode(char *buf, unsigned char); +static Str cConvEE(Str is); +static Str cConvEJ(Str is); +static Str cConvES(Str is); +static Str cConvSE(Str is); +static Str cConvJE(Str is); +char checkShiftCode(Str buf, uchar); static char *han2zen_tab[] = { @@ -94,33 +95,33 @@ static ConvRoutine FromEJ[] = { - {'J', cConvEJ, JSIcode, JSOcode}, - {'N', cConvEJ, NSIcode, NSOcode}, - {'n', cConvEJ, N2SIcode, N2SOcode}, - {'m', cConvEJ, N3SIcode, N3SOcode}, - {'U', cConvEJ, USIcode, USOcode}, - {'j', cConvEJ, J2SIcode, J2SOcode}, - {'S', cConvES, "", ""}, - {'E', cConvEE, "", ""} + {CODE_JIS_J, cConvEJ, JSIcode, JSOcode}, + {CODE_JIS_N, cConvEJ, NSIcode, NSOcode}, + {CODE_JIS_n, cConvEJ, N2SIcode, N2SOcode}, + {CODE_JIS_m, cConvEJ, N3SIcode, N3SOcode}, + {CODE_JIS_j, cConvEJ, J2SIcode, J2SOcode}, + {CODE_SJIS, cConvES, "", ""}, + {CODE_EUC, cConvEE, "", ""}, + {'\0', NULL, NULL, NULL} }; static ConvRoutine ToEJ[] = { - {'J', cConvJE, JSIcode, JSOcode}, - {'N', cConvJE, NSIcode, NSOcode}, - {'n', cConvJE, N2SIcode, N2SOcode}, - {'m', cConvJE, N3SIcode, N3SOcode}, - {'U', cConvJE, USIcode, USOcode}, - {'j', cConvJE, J2SIcode, J2SOcode}, - {'S', cConvSE, "", ""}, - {'E', cConvEE, "", ""} + {CODE_JIS_J, cConvJE, JSIcode, JSOcode}, + {CODE_JIS_N, cConvJE, NSIcode, NSOcode}, + {CODE_JIS_n, cConvJE, N2SIcode, N2SOcode}, + {CODE_JIS_m, cConvJE, N3SIcode, N3SOcode}, + {CODE_JIS_j, cConvJE, J2SIcode, J2SOcode}, + {CODE_SJIS, cConvSE, "", ""}, + {CODE_EUC, cConvEE, "", ""}, + {'\0', NULL, NULL, NULL} }; char * GetSICode(char key) { int i; - for (i = 0; i < CODES; i++) + for (i = 0; FromEJ[i].key != '\0' ; i++) if (FromEJ[i].key == key) return FromEJ[i].ShiftIn; return ""; @@ -130,7 +131,7 @@ GetSOCode(char key) { int i; - for (i = 0; i < CODES; i++) + for (i = 0; FromEJ[i].key != '\0'; i++) if (FromEJ[i].key == key) return FromEJ[i].ShiftOut; return ""; @@ -144,44 +145,62 @@ } Str -conv(char *is, char fc, char tc) +conv_str(Str is, char fc, char tc) { int i; Str os; + static char from_code = '\0'; + static char to_code = '\0'; + static Str (*conv_from) (); + static Str (*conv_to) (); - if (fc == 'E' && tc == 'E') - return cConvEE(is); - if (fc == tc || fc == '\0' || tc == '\0') - return Strnew_charp(is); + if (fc == tc || fc == CODE_ASCII || tc == CODE_ASCII) + return is; - if (fc == 'E') - os = Strnew_charp(is); + if (fc == CODE_INNER_EUC) + os = is; else { - for (i = 0; i < CODES; i++) { - if (ToEJ[i].key == fc) { - os = (*ToEJ[i].routine) (is); - goto next; + if (from_code != fc) { + for (i = 0; ToEJ[i].key != '\0'; i++) { + if (ToEJ[i].key == fc) { + from_code = fc; + conv_from = *ToEJ[i].routine; + goto next; + } } + n_impr(fc); + return NULL; } - n_impr(fc); - return NULL; + next: + os = conv_from(is); } - next: - if (tc == 'E') + if (tc == CODE_INNER_EUC || tc == CODE_EUC) return os; else { - for (i = 0; i < CODES; i++) { - if (FromEJ[i].key == tc) { - SIcode = FromEJ[i].ShiftIn; - SOcode = FromEJ[i].ShiftOut; - return (*FromEJ[i].routine) (os->ptr); + if (to_code != tc) { + for (i = 0; FromEJ[i].key != '\0'; i++) { + if (FromEJ[i].key == tc) { + SIcode = FromEJ[i].ShiftIn; + SOcode = FromEJ[i].ShiftOut; + to_code = tc; + conv_to = *FromEJ[i].routine; + goto next2; + } } + n_impr(tc); + return NULL; } - n_impr(tc); - return NULL; + next2: + return conv_to(os); } } +Str +conv(char *is, char fc, char tc) +{ + return conv_str(Strnew_charp(is), fc, tc); +} + static uchar getSLb(uchar * ptr, uchar * ub) { /* Get Shift-JIS Lower byte */ @@ -201,18 +220,19 @@ } static Str -cConvSE(char *is) +cConvSE(Str is) { /* Convert Shift-JIS to EUC-JP */ uchar *p, ub, lb; int state = SJIS_NOSTATE; - Str os = Strnew_size(strlen(is)); + Str os = Strnew_size(is->length); + uchar *endp = (uchar *) &is->ptr[is->length]; - for (p = (uchar *) is; *p != '\0'; p++) { + for (p = (uchar *) is->ptr; p < endp; p++) { switch (state) { case SJIS_NOSTATE: if (!(*p & 0x80)) /* ASCII */ Strcat_char(os, (char) (*p)); - else if (0x80 <= *p && *p <= 0x9f) { /* JIS X 0208, + else if (0x81 <= *p && *p <= 0x9f) { /* JIS X 0208, * 0213 */ ub = *p & 0x7f; state = SJIS_SHIFT_L; @@ -248,14 +268,15 @@ } static Str -cConvJE(char *is) +cConvJE(Str is) { /* Convert ISO-2022-JP to EUC-JP */ uchar *p, ub; char cset = CSET_ASCII; int state = ISO_NOSTATE; - Str os = Strnew_size(strlen(is)); + Str os = Strnew_size(is->length); + uchar *endp = (uchar *) &is->ptr[is->length]; - for (p = (uchar *) is; *p != '\0'; p++) { + for (p = (uchar *) is->ptr; p < endp; p++) { switch (state) { case ISO_NOSTATE: if (*p == ESC_CODE) /* ESC sequence */ @@ -332,22 +353,23 @@ } static Str -_cConvEE(char *is, char is_euc) +_cConvEE(Str is, char is_euc) { /* Convert EUC-JP to EUC-JP / ISO-2022-JP * (no JIS X 0201-Kana, 0212, 0213-2) */ uchar *p, ub, euc = 0; int state = EUC_NOSTATE; char cset = CSET_ASCII; Str os; + uchar *endp = (uchar *) &is->ptr[is->length]; if (is_euc) { - os = Strnew_size(strlen(is)); + os = Strnew_size(is->length); euc = 0x80; } else - os = Strnew_size(strlen(is) * 3 / 2); + os = Strnew_size(is->length * 3 / 2); - for (p = (uchar *) is; *p != '\0'; p++) { + for (p = (uchar *) is->ptr; p < endp; p++) { switch (state) { case EUC_NOSTATE: if (!(*p & 0x80)) { /* ASCII */ @@ -362,9 +384,9 @@ ub = *p; state = EUC_MBYTE1; } - else if (*p == 0x8e) /* SS2 + JIS X 0201-Kana */ + else if (*p == EUC_SS2_CODE) /* SS2 + JIS X 0201-Kana */ state = EUC_SS2; - else if (*p == 0x8f) /* SS3 + JIS X 0212, 0213-2 */ + else if (*p == EUC_SS3_CODE) /* SS3 + JIS X 0212, 0213-2 */ state = EUC_SS3; break; case EUC_MBYTE1: @@ -410,19 +432,19 @@ } static Str -cConvEE(char *is) +cConvEE(Str is) { return _cConvEE(is, TRUE); } static Str -cConvEJ(char *is) +cConvEJ(Str is) { return _cConvEE(is, FALSE); } -static void -put_js(Str os, uchar ub, uchar lb) +void +put_sjis(Str os, uchar ub, uchar lb) { ub -= 0x20; lb -= 0x20; @@ -440,13 +462,14 @@ } static Str -cConvES(char *is) +cConvES(Str is) { /* Convert EUC-JP to Shift-JIS */ uchar *p, ub; int state = EUC_NOSTATE; - Str os = Strnew_size(strlen(is)); + Str os = Strnew_size(is->length); + uchar *endp = (uchar *) &is->ptr[is->length]; - for (p = (uchar *) is; *p != '\0'; p++) { + for (p = (uchar *) is->ptr; p < endp; p++) { switch (state) { case EUC_NOSTATE: if (!(*p & 0x80)) /* ASCII */ @@ -456,21 +479,21 @@ ub = *p; state = EUC_MBYTE1; } - else if (*p == 0x8e) /* SS2 + JIS X 0201-Kana */ + else if (*p == EUC_SS2_CODE) /* SS2 + JIS X 0201-Kana */ state = EUC_SS2; - else if (*p == 0x8f) /* SS3 + JIS X 0212, 0213-2 */ + else if (*p == EUC_SS3_CODE) /* SS3 + JIS X 0212, 0213-2 */ state = EUC_SS3; break; case EUC_MBYTE1: if (0xa1 <= *p && *p <= 0xfe) /* JIS X 0208, 0213-1 */ - put_js(os, ub & 0x7f, *p & 0x7f); + put_sjis(os, ub & 0x7f, *p & 0x7f); else if (!(*p & 0x80)) /* broken ? */ Strcat_char(os, (char) (*p)); state = EUC_NOSTATE; break; case EUC_SS2: if (0xa0 <= *p && *p <= 0xdf) /* JIS X 0201-Kana */ - put_js(os, han2zen_tab[*p - 0xa0][0], + put_sjis(os, han2zen_tab[*p - 0xa0][0], han2zen_tab[*p - 0xa0][1]); state = EUC_NOSTATE; break; @@ -486,19 +509,23 @@ } /* - * static unsigned short sjis_shift[8] = { 0x7fff, 0xffff, 0x0, 0x0, 0x0, - * 0x0, 0xffff, 0x0 }; static unsigned short sjis_second[16] = { 0x0, 0x0, + * static ushort sjis_shift[8] = { 0x7fff, 0xffff, 0x0, 0x0, 0x0, + * 0x0, 0xffff, 0x0 }; static ushort sjis_second[16] = { 0x0, 0x0, * 0x0, 0x0, 0xffff, 0xffff, 0xffff, 0xfffe, 0xffff, 0xffff, 0xffff, * 0xffff, 0xffff, 0xffff, 0xffff, 0xfff8 }; */ char -checkShiftCode(char *buf, unsigned char hint) +checkShiftCode(Str buf, uchar hint) { uchar *p, si = '\0', so = '\0'; - int euc = (CODE_NORMAL | EUC_NOSTATE), sjis = (CODE_NORMAL | SJIS_NOSTATE), - iso = (CODE_NORMAL | ISO_NOSTATE), iso_kana = CODE_NORMAL; - - p = (uchar *) buf; + int euc = (CODE_NORMAL | EUC_NOSTATE), + sjis = (CODE_NORMAL | SJIS_NOSTATE), sjis_kana = CODE_NORMAL, + iso = (CODE_NORMAL | ISO_NOSTATE), iso_kana = CODE_NORMAL; + uchar *endp = &buf->ptr[buf->length]; + + if (hint == CODE_INNER_EUC) + return '\0'; + p = (uchar *) buf->ptr; while (1) { if (iso != CODE_ERROR && (si == '\0' || so == '\0')) { switch (ISO_STATE(iso)) { @@ -543,9 +570,9 @@ else if (0xa1 <= *p && *p <= 0xfe) /* JIS X 0208, * 0213-1 */ euc = (CODE_STATE(euc) | EUC_MBYTE1); - else if (*p == 0x8e) /* SS2 + JIS X 0201-Kana */ + else if (*p == EUC_SS2_CODE) /* SS2 + JIS X 0201-Kana */ euc = (CODE_STATE(euc) | EUC_SS2); - else if (*p == 0x8f) /* SS3 + JIS X 0212, 0213-2 */ + else if (*p == EUC_SS3_CODE) /* SS3 + JIS X 0212, 0213-2 */ euc = (CODE_STATE(euc) | EUC_SS3); else euc = CODE_ERROR; @@ -586,9 +613,11 @@ /* else if (0xe0 <= *p && *p <= 0xfc) */ /* JIS X 0213 */ sjis = (CODE_STATE(sjis) | SJIS_SHIFT_H); - else if (0xa0 <= *p && *p <= 0xdf) /* JIS X 0201-Kana + else if (0xa0 == *p) + sjis = (CODE_BROKEN | SJIS_NOSTATE); + else if (0xa1 <= *p && *p <= 0xdf) /* JIS X 0201-Kana */ - ; + sjis_kana = CODE_OK; else sjis = CODE_ERROR; break; @@ -609,7 +638,7 @@ } if (euc == CODE_ERROR || sjis == CODE_ERROR) break; - if (*p == '\0') + if (p == endp) break; p++; } @@ -620,58 +649,51 @@ case '@': switch (so) { case 'H': - return 'J'; + return CODE_JIS_J; case 'J': - return 'j'; + return CODE_JIS_j; case 'B': - return 'm'; + return CODE_JIS_m; default: - return 'm'; + return CODE_JIS_m; } case 'B': switch (so) { case 'J': - return 'N'; + return CODE_JIS_N; case 'B': - return 'n'; + return CODE_JIS_n; default: - return 'n'; + return CODE_JIS_n; } default: switch (so) { case 'H': - return 'J'; + return CODE_JIS_J; case 'J': - return 'N'; + return CODE_JIS_N; case 'B': - return 'n'; + return CODE_JIS_n; default: - return 'n'; + return CODE_JIS_n; } } } - if (hint == 'E') { + if (hint == CODE_EUC) { if (euc != CODE_ERROR) - return 'E'; - if (sjis != CODE_ERROR) - return 'S'; - return 'E'; - } - if (hint == 'S') { + return CODE_EUC; + } else if (hint == CODE_SJIS) { if (sjis != CODE_ERROR) - return 'S'; - if (euc != CODE_ERROR) - return 'E'; - return 'S'; + return CODE_SJIS; } if (CODE_STATE(euc) == CODE_OK) - return 'E'; + return CODE_EUC; if (CODE_STATE(sjis) == CODE_OK) - return 'S'; + return CODE_SJIS; if (CODE_STATE(euc) == CODE_NORMAL) - return 'E'; + return CODE_EUC; if (CODE_STATE(sjis) == CODE_NORMAL) - return 'S'; - return 'E'; + return CODE_SJIS; + return CODE_EUC; } #endif /* JP_CHARSET */ diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/cookie.c w3m-0.1.11-pre-kokb20/cookie.c --- w3m-0.1.11-pre/cookie.c Wed Jun 14 15:40:56 2000 +++ w3m-0.1.11-pre-kokb20/cookie.c Wed Nov 22 06:07:09 2000 @@ -1,4 +1,13 @@ -/* $Id: cookie.c,v 1.9 2000/06/14 06:26:09 aito Exp $ */ +/* $Id: cookie.c,v 1.2.4.4 2000/11/21 21:07:09 okabe Exp $ */ + +/* + * References for version 0 cookie: + * [NETACAPE] http://www.netscape.com/newsref/std/cookie_spec.html + * + * References for version 1 cookie: + * [RFC 2109] http://www.ics.uci.edu/pub/ietf/http/rfc2109.txt + * [DRAFT 12] http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-state-man-mec-12.txt + */ #include "fm.h" #include "html.h" @@ -15,11 +24,31 @@ static int is_saved = 1; +#define contain_no_dots(p, ep) (total_dot_number((p),(ep),1)==0) + +static int +total_dot_number(char *p, char *ep, int max_count) +{ + int count = 0; + if (!ep) + ep = p + strlen(p); + + for (; p < ep && count < max_count; p++) { + if (*p == '.') + count++; + } + return count; +} + + static char * domain_match(char *host, char *domain) { - int m0, m1, offset; + int m0, m1; + /* [RFC 2109] s. 2, "domain-match", case 1 + * (both are IP and identical) + */ regexCompile("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*", 0); m0 = regexMatch(host, 1); m1 = regexMatch(domain, 1); @@ -28,13 +57,31 @@ return host; } else if (!m0 && !m1) { - offset = (domain[0] != '.') ? 0 : strlen(host) - strlen(domain); - if (offset >= 0 && strcasecmp(&host[offset], domain) == 0) - return &host[offset]; + int offset; + char *domain_p; + /* + * "." match all domains (w3m only), + * and ".local" match local domains ([DRAFT 12] s. 2) + */ + if (strcasecmp(domain, ".") == 0 || + strcasecmp(domain, ".local") == 0) { + offset = strlen(host); + domain_p = &host[offset]; + if (domain[1] == '\0' || contain_no_dots(host, domain_p)) + return domain_p; + } + /* [RFC 2109] s. 2, cases 2, 3 */ + else { + offset = (domain[0] != '.') ? 0 : strlen(host) - strlen(domain); + domain_p = &host[offset]; + if (offset >= 0 && strcasecmp(domain_p, domain) == 0) + return domain_p; + } } return NULL; } + static struct portlist * make_portlist(Str port) { @@ -122,7 +169,7 @@ static int match_cookie(ParsedURL * pu, struct cookie *cookie) { - char *domainname = FQDN(pu->host); + char *domainname = (cookie->version == 0) ? FQDN(pu->host) : pu->host; if (!domainname) return 0; @@ -203,18 +250,6 @@ return tmp; } -static int -nodots(char *p, char *ep) -{ - if (!ep) - ep = p + strlen(p); - - for (; p < ep && *p != '.'; p++); - if (p < ep) - return 0; - return 1; -} - char *special_domain[] = { ".com", ".edu", ".gov", ".mil", ".net", ".org", ".int", NULL}; @@ -226,9 +261,12 @@ Str port, Str commentURL) { struct cookie *p; - char *domainname = FQDN(pu->host); + char *domainname = (version == 0) ? FQDN(pu->host) : pu->host; Str odomain = domain, opath = path; struct portlist *portlist = NULL; + int use_security = !(flag & COO_OVERRIDE); + +#define COOKIE_ERROR(err) if(!((err) & COO_OVERRIDE_OK) || use_security) return (err) #ifdef DEBUG fprintf(stderr, "host: [%s, %s] %d\n", pu->host, pu->file, flag); @@ -242,42 +280,66 @@ if (port) fprintf(stderr, "port: [%s]\n", port->ptr); #endif /* DEBUG */ + /* [RFC 2109] s. 4.3.2 case 2; but this (no request-host) shouldn't happen */ if (!domainname) - return 1; + return COO_ENODOT; if (domain) { char *dp; - char **sdomain; -#if 0 - if (domain->ptr[0] != '.') - return 1; -#endif /* 0 */ - if (nodots(&domain->ptr[1], &domain->ptr[domain->length])) - return 1; - if (!(dp = domain_match(domainname, domain->ptr))) - return 1; + /* [DRAFT 12] s. 4.2.2 (does not apply in the case that + * host name is the same as domain attribute for version 0 + * cookie) + * I think that this rule has almost the same effect as the + * tail match of [NETSCAPE]. + */ + if (domain->ptr[0] != '.' && + (version > 0 || strcasecmp(domainname, domain->ptr) != 0)) + domain = Sprintf(".%s", domain->ptr); + if (version == 0) { - for (sdomain = special_domain; *sdomain; sdomain++) { - int offset = domain->length - strlen(*sdomain); - if (offset >= 0 && strcasecmp(*sdomain, &domain->ptr[offset]) == 0) - break; + /* [NETSCAPE] rule */ + int n = total_dot_number(domain->ptr, + domain->ptr + domain->length, + 3); + if (n < 2) { + COOKIE_ERROR(COO_ESPECIAL); + } else if (n == 2) { + char **sdomain; + int ok = 0; + for (sdomain = special_domain; !ok && *sdomain; sdomain++) { + int offset = domain->length - strlen(*sdomain); + if (offset >= 0 && + strcasecmp(*sdomain, &domain->ptr[offset]) == 0) + ok = 1; + } + if (!ok) + COOKIE_ERROR(COO_ESPECIAL); } - if (!*sdomain && !nodots(domainname, dp)) - return 1; - } - else { - if (!nodots(domainname, dp)) - return 1; + } else { + /* [DRAFT 12] s. 4.3.2 case 2 */ + if (strcasecmp(domain->ptr, ".local") != 0 && + contain_no_dots(&domain->ptr[1], &domain->ptr[domain->length])) + COOKIE_ERROR(COO_ENODOT); } + + /* [RFC 2109] s. 4.3.2 case 3 */ + if (!(dp = domain_match(domainname, domain->ptr))) + COOKIE_ERROR(COO_EDOM); + /* [RFC 2409] s. 4.3.2 case 4 */ + /* Invariant: dp contains matched domain */ + if (version > 0 && !contain_no_dots(domainname, dp)) + COOKIE_ERROR(COO_EBADHOST); } if (path) { - if (version > 0 && strncmp(path->ptr, pu->file, path->length) != 0) - return 1; + /* [RFC 2109] s. 4.3.2 case 1 */ + if (version > 0 && strncmp(path->ptr, pu->file, path->length) != 0) + COOKIE_ERROR(COO_EPATH); } if (port) { + /* [DRAFT 12] s. 4.3.2 case 5 */ portlist = make_portlist(port); if (portlist && !port_match(portlist, pu->port)) - return 1; + COOKIE_ERROR(COO_EPORT); } if (!domain) @@ -525,7 +587,7 @@ Strcat_charp(src, tmp); Strcat_charp(src, ""); - Strcat_charp(src, ""); + Strcat_charp(src, "
"); if (!(p->flag & COO_SECURE)) { Strcat_charp(src, ""); } if (tmp2[0]) { @@ -548,6 +614,9 @@ Strcat_charp(src, " (Discard)"); Strcat_charp(src, ""); } + Strcat_charp(src, "
Cookie:"); Strcat_charp(src, htmlquote_str(make_cookie(p)->ptr)); @@ -538,7 +600,11 @@ } if (p->commentURL) { Strcat_charp(src, "
CommentURL:"); + Strcat_charp(src, "commentURL->ptr)); + Strcat_charp(src, "\">"); Strcat_charp(src, htmlquote_str(p->commentURL->ptr)); + Strcat_charp(src, ""); Strcat_charp(src, "
Version:"); + Strcat_charp(src, Sprintf("%d", p->version)->ptr); + Strcat_charp(src, "
"); if (p->domain) { Strcat_charp(src, "
Domain:"); Strcat_charp(src, htmlquote_str(p->domain->ptr)); @@ -576,7 +645,7 @@ Strcat_charp(src, "

"); } Strcat_charp(src, ""); - return loadHTMLString(src->ptr); + return loadHTMLString(src); } void @@ -601,5 +670,28 @@ arg = arg->next; } backBf(); +} + +int +check_cookie_accept_domain(char *domain) +{ + TextListItem *tl; + + if (domain == NULL) + return 0; + + if (Cookie_accept_domains && Cookie_accept_domains->nitem > 0) { + for (tl = Cookie_accept_domains->first; tl != NULL; tl = tl->next) { + if (domain_match(domain, tl->ptr)) + return 1; + } + } + if (Cookie_reject_domains && Cookie_reject_domains->nitem > 0) { + for (tl = Cookie_reject_domains->first; tl != NULL; tl = tl->next) { + if (domain_match(domain, tl->ptr)) + return 0; + } + } + return 1; } #endif /* USE_COOKIE */ diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/ctrlcode.h w3m-0.1.11-pre-kokb20/ctrlcode.h --- w3m-0.1.11-pre/ctrlcode.h Tue Jun 6 14:39:13 2000 +++ w3m-0.1.11-pre-kokb20/ctrlcode.h Sun Nov 19 05:02:56 2000 @@ -1,32 +1,153 @@ +/* control characters */ - - -#define CTRL_A 1 -#define CTRL_B 2 -#define CTRL_C 3 -#define CTRL_D 4 -#define CTRL_E 5 -#define CTRL_F 6 -#define CTRL_G 7 -#define CTRL_H 8 -#define CTRL_I 9 -#define CTRL_J 10 -#define CTRL_K 11 -#define CTRL_L 12 -#define CTRL_M 13 -#define CTRL_N 14 -#define CTRL_O 15 -#define CTRL_P 16 -#define CTRL_Q 17 -#define CTRL_R 18 -#define CTRL_S 19 -#define CTRL_T 20 -#define CTRL_U 21 -#define CTRL_V 22 -#define CTRL_W 23 -#define CTRL_X 24 -#define CTRL_Y 25 -#define CTRL_Z 26 +#define CTRL_A 1 +#define CTRL_B 2 +#define CTRL_C 3 +#define CTRL_D 4 +#define CTRL_E 5 +#define CTRL_F 6 +#define CTRL_G 7 +#define CTRL_H 8 +#define CTRL_I 9 +#define CTRL_J 10 +#define CTRL_K 11 +#define CTRL_L 12 +#define CTRL_M 13 +#define CTRL_N 14 +#define CTRL_O 15 +#define CTRL_P 16 +#define CTRL_Q 17 +#define CTRL_R 18 +#define CTRL_S 19 +#define CTRL_T 20 +#define CTRL_U 21 +#define CTRL_V 22 +#define CTRL_W 23 +#define CTRL_X 24 +#define CTRL_Y 25 +#define CTRL_Z 26 #define ESC_CODE 27 #define DEL_CODE 127 + +/* ISO-8859-1 alphabet characters */ + +#define NBSP_CODE 160 +#define IEXCL_CODE 161 +#define CENT_CODE 162 +#define POUND_CODE 163 +#define CURREN_CODE 164 +#define YEN_CODE 165 +#define BRVBAR_CODE 166 +#define SECT_CODE 167 +#define UML_CODE 168 +#define COPY_CODE 169 +#define ORDF_CODE 170 +#define LAQUO_CODE 171 +#define NOT_CODE 172 +#define SHY_CODE 173 +#define REG_CODE 174 +#define MACR_CODE 175 +#define DEG_CODE 176 +#define PLUSMN_CODE 177 +#define SUP2_CODE 178 +#define SUP3_CODE 179 +#define ACUTE_CODE 180 +#define MICRO_CODE 181 +#define PARA_CODE 182 +#define MIDDOT_CODE 183 +#define CEDIL_CODE 184 +#define SUP1_CODE 185 +#define ORDM_CODE 186 +#define RAQUO_CODE 187 +#define FRAC14_CODE 188 +#define FRAC12_CODE 189 +#define FRAC34_CODE 190 +#define IQUEST_CODE 191 +#define AGRAVE_CODE 192 +#define AACUTE_CODE 193 +#define ACIRC_CODE 194 +#define ATILDE_CODE 195 +#define AUML_CODE 196 +#define ARING_CODE 197 +#define AELIG_CODE 198 +#define CCEDIL_CODE 199 +#define EGRAVE_CODE 200 +#define EACUTE_CODE 201 +#define ECIRC_CODE 202 +#define EUML_CODE 203 +#define IGRAVE_CODE 204 +#define IACUTE_CODE 205 +#define ICIRC_CODE 206 +#define IUML_CODE 207 +#define ETH_CODE 208 +#define NTILDE_CODE 209 +#define OGRAVE_CODE 210 +#define OACUTE_CODE 211 +#define OCIRC_CODE 212 +#define OTILDE_CODE 213 +#define OUML_CODE 214 +#define TIMES_CODE 215 +#define OSLASH_CODE 216 +#define UGRAVE_CODE 217 +#define UACUTE_CODE 218 +#define UCIRC_CODE 219 +#define UUML_CODE 220 +#define YACUTE_CODE 221 +#define THORN_CODE 222 +#define SZLIG_CODE 223 +#define aGRAVE_CODE 224 +#define aACUTE_CODE 225 +#define aCIRC_CODE 226 +#define aTILDE_CODE 227 +#define aUML_CODE 228 +#define aRING_CODE 229 +#define aELIG_CODE 230 +#define cCEDIL_CODE 231 +#define eGRAVE_CODE 232 +#define eACUTE_CODE 233 +#define eCIRC_CODE 234 +#define eUML_CODE 235 +#define iGRAVE_CODE 236 +#define iACUTE_CODE 237 +#define iCIRC_CODE 238 +#define iUML_CODE 239 +#define eth_CODE 240 +#define nTILDE_CODE 241 +#define oGRAVE_CODE 242 +#define oACUTE_CODE 243 +#define oCIRC_CODE 244 +#define oTILDE_CODE 245 +#define oUML_CODE 246 +#define DIVIDE_CODE 247 +#define oSLASH_CODE 248 +#define uGRAVE_CODE 249 +#define uACUTE_CODE 250 +#define uCIRC_CODE 251 +#define uUML_CODE 252 +#define yACUTE_CODE 253 +#define thorn_CODE 254 +#define yUML_CODE 255 + +/* EUC control characters */ + +#define EUC_SS2_CODE 0x8e +#define EUC_SS3_CODE 0x8f + +/* internally used characters */ + +#define ANSP_CODE 0x80 /* use for empty anchor */ +#define IMSP_CODE 0x81 /* blank around image */ + +#define NBSP "\xa0" +#define ANSP "\x80" +#define IMSP "\x81" + +#define IS_KANJI(ch) ((unsigned char)(ch)>=0xa1&&(unsigned char)(ch)<=0xfe) +#define IS_INTERNAL_SPACE(ch) ((unsigned char)(ch)>=0x80&&(unsigned char)(ch)<=0xa0) +#define IS_INTERNAL_CHAR(ch) IS_INTERNAL_SPACE(ch) + +/* Local Variables: */ +/* c-basic-offset: 4 */ +/* tab-width: 8 */ +/* End: */ diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/display.c w3m-0.1.11-pre-kokb20/display.c --- w3m-0.1.11-pre/display.c Wed Jun 14 19:26:34 2000 +++ w3m-0.1.11-pre-kokb20/display.c Wed Nov 22 06:07:09 2000 @@ -1,4 +1,4 @@ -/* $Id: display.c,v 1.12 2000/06/14 06:26:09 aito Exp $ */ +/* $Id: display.c,v 1.1.1.1.4.3 2000/11/21 21:07:09 okabe Exp $ */ #include #include "fm.h" @@ -230,7 +230,7 @@ if (!use_mouse) msg = Sprintf("Viewing <%s> ", cleanup_str(buf->buffername)); else -#if LANG == JA +#ifdef KANJI_SYMBOLS msg = Sprintf("≪↑↓Viewing <%s> ", cleanup_str(buf->buffername)); #else /* LANG != JA */ msg = Sprintf("<=UpDn Viewing <%s> ", cleanup_str(buf->buffername)); @@ -307,10 +307,12 @@ clrtobotx(); } +#define addKanji(pc,pr) (addChar((pc)[0],(pr)[0]),addChar((pc)[1],(pr)[1])) + Line * redrawLine(Buffer * buf, Line * l, int i) { - int j, pos, rcol; + int j, pos, rcol, ncol, delta; int column = buf->currentColumn; char *p; Lineprop *pr; @@ -335,27 +337,37 @@ pr = &(l->propBuf[pos]); rcol = COLPOS(l, pos); - for (j = 0; rcol - column < COLS && pos + j < l->len; j++) { +#ifndef JP_CHARSET + delta = 1; +#endif + for (j = 0; rcol - column < COLS && pos + j < l->len; j += delta) { #ifdef JP_CHARSET - if (rcol - column == COLS - 1 && CharType(pr[j]) == PC_KANJI1) + if (CharType(pr[j]) == PC_KANJI1) + delta = 2; + else + delta = 1; +#endif + ncol = COLPOS(l, pos + j + delta); + if (ncol - column > COLS) break; -#endif /* JP_CHARSET */ + if (rcol < column) { + for (rcol = column; rcol < ncol; rcol++) + addChar(' ', 0); + continue; + } if (p[j] == '\t') { - do { - if (rcol >= column) - addChar(' ', 0); - } while ((++rcol % Tabstop) != 0); + for (; rcol < ncol; rcol++) + addChar(' ', 0); } - else { #ifdef JP_CHARSET - if (rcol == column && CharType(pr[j]) == PC_KANJI2) - addChar(' ', 0); - else -#endif /* JP_CHARSET */ - if (rcol >= column) - addChar(p[j], pr[j]); - rcol++; + else if (delta == 2) { + addKanji(&p[j], &pr[j]); + } +#endif + else { + addChar(p[j], pr[j]); } + rcol = ncol; } if (somode) { somode = FALSE; @@ -405,7 +417,7 @@ int redrawLineRegion(Buffer * buf, Line * l, int i, int bpos, int epos) { - int j, pos, rcol; + int j, pos, rcol, ncol, delta; int column = buf->currentColumn; char *p; Lineprop *pr; @@ -420,34 +432,41 @@ bcol = bpos - pos; ecol = epos - pos; - for (j = 0; rcol - column < COLS && pos + j < l->len; j++) { +#ifndef JP_CHARSET + delta = 1; +#endif + for (j = 0; rcol - column < COLS && pos + j < l->len; j += delta) { #ifdef JP_CHARSET - if (rcol - column == COLS - 1 && CharType(pr[j]) == PC_KANJI1) + if (CharType(pr[j]) == PC_KANJI1) + delta = 2; + else + delta = 1; +#endif + ncol = COLPOS(l, pos + j + delta); + if (ncol - column > COLS) break; - if (rcol == column && CharType(pr[j]) == PC_KANJI2) { - if (j >= bcol && j < ecol) { + if (j >= bcol && j < ecol) { + if (rcol < column) { move(i, 0); - addChar(' ', 0); + for (rcol = column; rcol < ncol; rcol++) + addChar(' ', 0); + continue; } - rcol++; - } - else -#endif /* JP_CHARSET */ - if (p[j] == '\t') { - do { - if (rcol >= column && j >= bcol && j < ecol) { - move(i, rcol - column); + move(i, rcol - column); + if (p[j] == '\t') { + for (; rcol < ncol; rcol++) addChar(' ', 0); - } - } while ((++rcol % Tabstop) != 0); - } - else { - if (rcol >= column && j >= bcol && j < ecol) { - move(i, rcol - column); + } +#ifdef JP_CHARSET + else if (delta == 2) { + addKanji(&p[j], &pr[j]); + } +#endif + else { addChar(p[j], pr[j]); } - rcol++; } + rcol = ncol; } if (somode) { somode = FALSE; @@ -493,27 +512,27 @@ #define do_effect1(effect,modeflag,action_start,action_end) \ if (m & effect) { \ - if (!modeflag) { \ - action_start; \ - modeflag = TRUE; \ - } \ + if (!modeflag) { \ + action_start; \ + modeflag = TRUE; \ + } \ } #define do_effect2(effect,modeflag,action_start,action_end) \ if (modeflag) { \ - action_end; \ - modeflag = FALSE; \ + action_end; \ + modeflag = FALSE; \ } void do_effects(Lineprop m) { /* effect end */ - do_effect2(PE_UNDER, ulmode, underline(), underlineend()) - do_effect2(PE_STAND, somode, standout(), standend()) - do_effect2(PE_BOLD, bomode, bold(), boldend()) - do_effect2(PE_EMPH, emph_mode, bold(), boldend()) - do_effect2(PE_ANCHOR, anch_mode, EFFECT_ANCHOR_START, EFFECT_ANCHOR_END); + do_effect2(PE_UNDER, ulmode, underline(), underlineend()); + do_effect2(PE_STAND, somode, standout(), standend()); + do_effect2(PE_BOLD, bomode, bold(), boldend()); + do_effect2(PE_EMPH, emph_mode, bold(), boldend()); + do_effect2(PE_ANCHOR, anch_mode, EFFECT_ANCHOR_START, EFFECT_ANCHOR_END); do_effect2(PE_IMAGE, imag_mode, EFFECT_IMAGE_START, EFFECT_IMAGE_END); do_effect2(PE_FORM, form_mode, EFFECT_FORM_START, EFFECT_FORM_END); do_effect2(PE_ACTIVE, active_mode, EFFECT_ACTIVE_START, EFFECT_ACTIVE_END); @@ -525,11 +544,11 @@ #endif /* not KANJI_SYMBOLS */ /* effect start */ - do_effect1(PE_UNDER, ulmode, underline(), underlineend()) - do_effect1(PE_STAND, somode, standout(), standend()) - do_effect1(PE_BOLD, bomode, bold(), boldend()) - do_effect1(PE_EMPH, emph_mode, bold(), boldend()) - do_effect1(PE_ANCHOR, anch_mode, EFFECT_ANCHOR_START, EFFECT_ANCHOR_END); + do_effect1(PE_UNDER, ulmode, underline(), underlineend()); + do_effect1(PE_STAND, somode, standout(), standend()); + do_effect1(PE_BOLD, bomode, bold(), boldend()); + do_effect1(PE_EMPH, emph_mode, bold(), boldend()); + do_effect1(PE_ANCHOR, anch_mode, EFFECT_ANCHOR_START, EFFECT_ANCHOR_END); do_effect1(PE_IMAGE, imag_mode, EFFECT_IMAGE_START, EFFECT_IMAGE_END); do_effect1(PE_FORM, form_mode, EFFECT_FORM_START, EFFECT_FORM_END); do_effect1(PE_ACTIVE, active_mode, EFFECT_ACTIVE_START, EFFECT_ACTIVE_END); @@ -550,14 +569,12 @@ #ifdef JP_CHARSET if (CharType(mode) != PC_KANJI2) - do_effects(m); - if (c & 0x80 && CharType(mode) == PC_ASCII) { - addch(' '); +#endif /* JP_CHARSET */ + do_effects(m); + if (IS_UNPRINTABLE_ASCII(c, mode)) { + addstr(Sprintf("\\%3o", (unsigned char)c)->ptr); } else -#else /* not JP_CHARSET */ - do_effects(m); -#endif /* not JP_CHARSET */ #ifndef KANJI_SYMBOLS if (graph_mode) addch(g_rule[PC_RULE_VAL(m)]); @@ -566,34 +583,14 @@ if (c == '\t') { addch(c); } - else if (!(c & ~0x1f) && c != CTRL_J) { /* Control code */ + else if (c == DEL_CODE) + addstr("^?"); + else if (IS_UNPRINTABLE_CONTROL(c)) { /* Control code */ addch('^'); addch(c + '@'); } - else if (c == DEL_CODE) - addstr("^?"); -#if LANG != EN else if (c != '\n') addch(c); -#else - else if ((unsigned char) c == 0xa0) /* NO-BREAK SPACE */ - addch(' '); - else if (c != '\n') { -#ifdef __EMX__ - extern int CodePage; - if (CodePage || (unsigned char) c < 0x80 || (unsigned char) c > 0x9F) { -#else - if ((unsigned char) c < 0x80 || (unsigned char) c > 0x9F) { -#endif - addch(c); - } - else { - /* else: Eliminate unprintables according to * iso-8859-*. - * Particularly 0x96 messes up T.Dickey's * (xfree-)xterm */ - addch(' '); - } - } -#endif else /* \n */ addch(' '); } @@ -698,6 +695,8 @@ if (buf->firstLine == NULL) return; + if (buf->pos == l->len) + return; i = buf->pos; p = l->propBuf; #ifdef JP_CHARSET @@ -705,7 +704,7 @@ delta = 2; #endif /* JP_CHARSET */ if (i + delta < l->len) { - buf->pos = i + delta; + buf->pos = i + delta; } else if (l->len == 0) { buf->pos = 0; @@ -829,8 +828,16 @@ buf->pos = i; } else if (Currentbuf->currentLine->len > i) { + int delta = 1; +#ifdef JP_CHARSET + if (Currentbuf->currentLine->len > i + 1 && + CharType(buf->currentLine->propBuf[i + 1]) == PC_KANJI2) + delta = 2; +#endif buf->cursorX = 0; - buf->pos = i + 1; + buf->pos = i; + if (COLPOS(buf->currentLine, i + delta) <= buf->currentColumn) + buf->pos += delta; } else { buf->cursorX = 0; @@ -867,3 +874,8 @@ cursorLeft(buf); } } + +/* Local Variables: */ +/* c-basic-offset: 4 */ +/* tab-width: 8 */ +/* End: */ diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/doc/MANUAL.html w3m-0.1.11-pre-kokb20/doc/MANUAL.html --- w3m-0.1.11-pre/doc/MANUAL.html Fri Apr 7 12:12:10 2000 +++ w3m-0.1.11-pre-kokb20/doc/MANUAL.html Mon Oct 23 21:13:05 2000 @@ -111,6 +111,9 @@ with -cols option.

-cols width
Specify document width. Used with -dump option. +
-ppc count +
Specify the number of pixels per character (default 8.0). Larger + values will make tables narrower.
-dump_source
Read document specified by URL and dump the source.
-dump_head diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/doc/keymap.lynx w3m-0.1.11-pre-kokb20/doc/keymap.lynx --- w3m-0.1.11-pre/doc/keymap.lynx Tue Jan 4 14:46:50 2000 +++ w3m-0.1.11-pre-kokb20/doc/keymap.lynx Tue Oct 24 00:08:19 2000 @@ -11,10 +11,10 @@ # Left : LEFT, ^[[D keymap C-@ MARK -keymap C-a LINE_BEGIN -keymap C-b BACK -keymap C-e LINE_END -keymap C-f GOTO_LINK +keymap C-a BEGIN +keymap C-b PREV_PAGE +keymap C-e END +keymap C-f NEXT_PAGE keymap C-h HISTORY keymap TAB NEXT_LINK keymap C-j GOTO_LINK @@ -59,6 +59,7 @@ keymap U GOTO keymap V LOAD keymap Z CENTER_H +keymap \\ SOURCE keymap \^ LINE_BEGIN keymap a ADD_BOOKMARK keymap b PREV_PAGE diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/doc/w3m.1 w3m-0.1.11-pre-kokb20/doc/w3m.1 --- w3m-0.1.11-pre/doc/w3m.1 Tue Jan 4 14:46:50 2000 +++ w3m-0.1.11-pre-kokb20/doc/w3m.1 Wed Oct 18 14:43:32 2000 @@ -83,6 +83,10 @@ .B -cols width specify column width (used with -dump) .TP +.B -ppc count +specify the number of pixels per character (default 8.0) +Larger values will make tables narrower. +.TP .B -dump_source dump page source into stdout .TP diff -urN -x CVS -x config.h -x config.param -x XXMakefile -x gc w3m-0.1.11-pre/doc-jp/HISTORY.kokb w3m-0.1.11-pre-kokb20/doc-jp/HISTORY.kokb --- w3m-0.1.11-pre/doc-jp/HISTORY.kokb Tue Jan 4 14:46:51 2000 +++ w3m-0.1.11-pre-kokb20/doc-jp/HISTORY.kokb Wed Nov 22 19:25:00 2000 @@ -1,32 +1,729 @@ +2000/11/22 - w3m の非公式パッチ更新記録 +From: Okabe Katsuya + 主に高速化のための変更です. + ・ファイル読み込み時に自前でバッファリングを行なうようにした. + ・conv.c の関数を Str ベースに変更. + 可能な限り文字列のコピーを行なわないようにした. + ・checkType の高速化. + ・カーソル上に文字が無いとき cursorRight の動作に問題があったので, + 修正した. + また一行が LINELEN を越えたときに, calcPosition で配列の外をアク + セスする可能性があるのでサイズを変更. - (1999/08/11) 岡部克也 - okabe@fphy.hep.okayama-u.ac.jp - okabe@okaibm.hep.okayama-u.ac.jp +From: Fumitoshi UKAI +Subject: [w3m-dev 01372] w3m sometimes uses the wrong mailcap entry + http://bugs.debian.org/77679 + ですが、mime type の判断が substring match になってるからだと + 思います。これで直るんじゃないでしょうか -99/8/11 - - table が入れ子になっているとき, インデントされない問題を修正. - 同様に, caption がインデントされない問題を修正. + +2000/11/20 -99/8/10 - - table 中の table が TABLE_EXPAND マクロに関係なく伸長されていたので, - TABLE_EXPAND マクロが定義されているときのみ伸長するようにした. +From: Okabe Katsuya + 中身の無い table が table の中にあるときに, 外の table が崩れる問 + 題への対処. - の width 属性で与えた幅と, width 属性がないときの幅の既定値を - 区別するようにした. 具体的には table 構造体の total_width 変数に - width 属性で与えた幅をセットするようにした. - width 属性がないときの重みを小さくした. +2000/11/19 - もし float.h が存在すれば, matrix.c で float.h をインクルードするよう - にした. float.h の有無は configure でチェックするようにした. +From: Okabe Katsuya + gc6 対応. - table のレンダリングに最小二乗法を使うかどうかを configure で決めるよ - うにした. -

で空行の入る位置がおかしくなることがある問題の修正. +2000/11/18 - table 中の

 タグの中にあるタブを正しく解釈するようにした.
\ No newline at end of file
+From: Okabe Katsuya 
+  ・バッファ内部の空白文字を 0x80-0x9f に割当てるように変更した.
+  ・日本語版でも, バッファ内では   は 0xa0 で表わすにした.
+  ・坂本さんの簡易 UTF-8 版の UTF-8 とは関係無い部分のコードをマージ
+    した.
+    またデバッグのときに便利なので, 内部コードを文書コードに指定する
+    事ができるようにした.
+  ・表示不可能領域 (0x80-0xa0) にある文字は \xxx の形で表示するよう
+    にした.
+    関連して, 画面シフト時に, コントロール文字が含まれていると表示が
+    乱れるバグがあったので修正した.
+
+From: Tsutomu Okada (岡田 勉) 
+Subject: [w3m-dev 01354] minimize when #undef USE_GOPHER or USE_NNTP
+  #undef USE_GOPHER や #undef USE_NNTP としたときに、関連するコードがで
+  きるだけ少なくなるように変更してみました。
+
+
+2000/11/16
+
+From: Okabe Katsuya 
+  異常な実体参照で getescapechar が変は値を返す事がある問題への対処.
+
+
+2000/11/15
+
+From: Okabe Katsuya 
+  ・table の枠が崩れる事があるバグの修正.
+  ・DEL 文字を折り返し可能な空白文字として扱うように変更し, バッファ
+    内部の空白文字を   から DEL に変更.
+
+From: Kiyokazu SUTO 
+Subject: [w3m-dev 01338] Re: Lynx patch for character encoding in form
+Subject: [w3m-dev 01342] Re: Lynx patch for character encoding in form
+  form タグの accept-charset 属性を受け付けるようになった.
+
+
+2000/11/14
+
+From: Okabe Katsuya 
+  ・クォートするのを忘れていると思われる部分を修正.
+  ・cleanup_str, htmlquote_str は, もし (アン) クォートする必要が無
+    ければ, 元の文字列をそのまま返すようにした.
+
+
+2000/11/10
+
+From: 渡邉勝之 
+Subject: [w3m-dev 01336] patch for Cygwin 1.1.x
+  Cygwin 1.1.x (おそらく 1.1.3 以降) 向けのパッチを作成しました。
+  Cygwin 1.x 以降の環境において、
+  ・標準のインストールパスを /cygnus/cygwin-b20/H-i586-cygwin32
+    以下へ変更しない
+  ・T_as,T_ae,T_ac を空にするのをやめた
+
+
+2000/11/8
+
+From: Jan Nieuwenhuizen 
+Subject: [w3m-dev-en 00189] [PATCH] w3m menu