commit b583f19e2441c441e4696ed065c2e1fcb3202a36
parent 9f2f71179f93c4e616b4afa6e572662745091bc0
Author: ukai <ukai>
Date: Fri, 24 Jan 2003 17:57:07 +0000
[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>
Diffstat:
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -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
diff --git a/file.c b/file.c
@@ -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) {