On 06/10/2009 08:18 AM, أحمد المحمودي wrote:
> Hello,
>
> Sorry, in yesterday's email, I didn't issue a 'bt' command in GDB,
> here is the backtrace:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1225446624 (LWP 25859)]
> init_document_options (ses=0x0, doo=0xbfa7832c) at
> /tmp/buildd/elinks-0.13~20090601/src/document/options.c:39
> 39 /tmp/buildd/elinks-0.13~20090601/src/document/options.c: No such file
> or directory.
> in /tmp/buildd/elinks-0.13~20090601/src/document/options.c
> (gdb) bt
> #0 init_document_options (ses=0x0, doo=0xbfa7832c) at
> /tmp/buildd/elinks-0.13~20090601/src/document/options.c:39
> #1 0x0813ef1d in dump_formatted (fd=1, download=0x0, cached=0x8cf5e58)
> at /tmp/buildd/elinks-0.13~20090601/src/viewer/dump/dump.c:117
> [...]
OK, the problem is clear now.
The patch in question contains the following:
> diff --git a/src/document/options.c b/src/document/options.c
> index 9208d64..93d9c7b 100644
> --- a/src/document/options.c
> +++ b/src/document/options.c
> @@ -32,6 +32,13 @@ init_document_options(struct session *ses, struct
> document_options *doo)
>
> doo->use_document_colors =
> get_opt_int("document.colors.use_document_colors", ses);
> doo->margin = get_opt_int("document.browse.margin_width", ses);
> +
> + doo->document_width = 0;
> + if (get_opt_bool("document.browse.use_preferred_document_width", ses))
> + doo->document_width =
> get_opt_int("document.browse.preferred_document_width", ses);
> + if (doo->document_width <= 0 || doo->document_width >
> ses->tab->term->width)
> + doo->document_width = ses->tab->term->width;
ses is NULL when ELinks is run with -dump.
Before the patch, the renderer used document_options.box instead of
document_options.document_width. Both the dump viewer and the regular
viewer set document_options.box after calling init_document_options.
Really, I think that the patch should be using document_options.box
instead of ses->tab->term->width regardless of which viewer is used
(dump or regular).
So here is one possible solution:
1. Both callers to init_document_options (render_document_frames and
dump_formatted) should first set document_options.box and then call
init_document_options;
2. init_document_options should preserve document_options.box (it
currently clears the whole structure at the beginning of the routine); and
3. the patch should be changed to use document_options.box.
Alternatively to 1 and 2, callers to init_document_options could pass
the values for the box as arguments so that init_document_options can
set document_options.box itself.
Does the above sound reasonable?
--
Miciah Masters <[email protected]> / <[email protected]>
_______________________________________________
elinks-dev mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-dev