diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-24 17:57:07 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-24 17:57:07 +0000 |
commit | a727eef7941751a8040ff0270806ef144cb30949 (patch) | |
tree | 35af6adde55d95ad4d94193be280c622dd4d5a6b | |
parent | file.c (getNextPage): no need volatile for code (diff) | |
download | w3m-a727eef7941751a8040ff0270806ef144cb30949.tar.gz w3m-a727eef7941751a8040ff0270806ef144cb30949.zip |
[w3m-dev 03684] Re: fold patch
* file.c (PSIZE): added
(HTMLlineproc2body): outc,outp is created by NewAtom_N
use PSIZE
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | file.c | 19 |
2 files changed, 19 insertions, 9 deletions
@@ -1,3 +1,10 @@ +2003-01-25 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03684] Re: fold patch + * file.c (PSIZE): added + (HTMLlineproc2body): outc,outp is created by NewAtom_N + use PSIZE + 2003-01-25 Fumitoshi UKAI <ukai@debian.or.jp> * file.c (getNextPage): no need volatile for code @@ -6846,4 +6853,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.715 2003/01/24 17:54:07 ukai Exp $ +$Id: ChangeLog,v 1.716 2003/01/24 17:57:07 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.207 2003/01/24 17:54:13 ukai Exp $ */ +/* $Id: file.c,v 1.208 2003/01/24 17:57:07 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -4959,6 +4959,12 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) } #define PPUSH(p,c) {outp[pos]=(p);outc[pos]=(c);pos++;} +#define PSIZE \ + if (out_size <= pos + 1) { \ + out_size = pos * 3 / 2; \ + outc = New_Reuse(char, outc, out_size); \ + outp = New_Reuse(Lineprop, outp, out_size); \ + } static TextLineListItem *_tl_lp2; @@ -5004,8 +5010,8 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) if (out_size == 0) { out_size = LINELEN; - outc = New_N(char, out_size); - outp = New_N(Lineprop, out_size); + outc = NewAtom_N(char, out_size); + outp = NewAtom_N(Lineprop, out_size); } n_textarea = -1; @@ -5047,11 +5053,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) str = line->ptr; endp = str + line->length; while (str < endp) { - if (out_size <= pos) { - out_size = pos * 3 / 2; - outc = New_N(char, out_size); - outp = New_N(Lineprop, out_size); - } + PSIZE; mode = get_mctype(str); #ifndef KANJI_SYMBOLS if (effect & PC_RULE && *str != '<') { @@ -5081,6 +5083,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) int emode; p = getescapecmd(&str); while (*p) { + PSIZE; emode = get_mctype(p); #ifdef JP_CHARSET if (emode == PC_KANJI) { |