diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-12-20 20:20:52 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-12-20 20:20:52 +0000 |
commit | 62dc71c28c8b3fba04ef28f58d74f3ca51abf7b7 (patch) | |
tree | 1c4a114dcff37404eb76a949855f6b01a2ac4f02 | |
parent | update TODO (diff) | |
download | w3m-62dc71c28c8b3fba04ef28f58d74f3ca51abf7b7.tar.gz w3m-62dc71c28c8b3fba04ef28f58d74f3ca51abf7b7.zip |
[w3m-dev 03590] segmentation fault when <title> exist after <img>
* file.c (save_line): deleted
(save_prevchar): deleted
(save_obuf): added
(HTMLtagproc1): bcopy save_obuf
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | file.c | 13 |
2 files changed, 14 insertions, 9 deletions
@@ -1,3 +1,11 @@ +2002-12-21 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03590] segmentation fault when <title> exist after <img> + * file.c (save_line): deleted + (save_prevchar): deleted + (save_obuf): added + (HTMLtagproc1): bcopy save_obuf + 2002-12-20 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> * [w3m-dev 03588] include time.h in ftp.c @@ -5974,4 +5982,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.636 2002/12/19 15:29:05 ukai Exp $ +$Id: ChangeLog,v 1.637 2002/12/20 20:20:52 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.164 2002/12/18 16:25:11 ukai Exp $ */ +/* $Id: file.c,v 1.165 2002/12/20 20:20:53 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -95,8 +95,7 @@ static char check_charset(char *s); static char check_accept_charset(char *s); #endif -static Str save_line = NULL; -static int save_prevchar = ' '; +static struct readbuffer save_obuf; struct link_stack { int cmd; @@ -4301,9 +4300,8 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) return 1; case HTML_TITLE: append_tags(obuf); - save_line = obuf->line; - save_prevchar = obuf->prevchar; set_breakpoint(obuf, 0); + bcopy((void *)obuf, (void *)&save_obuf, sizeof(struct readbuffer)); obuf->line = Strnew(); discardline(obuf, 0); obuf->flag |= (RB_NOBR | RB_TITLE); @@ -4312,12 +4310,11 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) if (!(obuf->flag & RB_TITLE)) return 1; obuf->flag &= ~(RB_NOBR | RB_TITLE); - append_tags(obuf); tmp = Strnew_charp(obuf->line->ptr); Strremovetrailingspaces(tmp); h_env->title = html_unquote(tmp->ptr); - obuf->line = save_line; - obuf->prevchar = save_prevchar; + bcopy((void *)&save_obuf, (void *)obuf, sizeof(struct readbuffer)); + append_tags(obuf); back_to_breakpoint(obuf); tmp = Strnew_m_charp("<title_alt title=\"", html_quote(h_env->title), "\">", NULL); |