1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Merge branch 'elinks-0.12' into elinks-0.13

Conflicts:
	NEWS
	src/config/options.c (session-specific options vs. TERM_* constants)
This commit is contained in:
Kalle Olavi Niemitalo 2009-04-26 17:16:00 +03:00 committed by Kalle Olavi Niemitalo
commit 6dfc25f5d2
5 changed files with 60 additions and 16 deletions

7
NEWS
View File

@ -71,6 +71,13 @@ have already been considered.
(mostly reverted)
//////////////////////////////////////////////////////////////////////
ELinks 0.12pre3.GIT now:
------------------------
To be released as 0.12pre4, 0.12rc1, or even 0.12.0.
* critical bug 1071: Fix crash in get_dom_node_child.
ELinks 0.12pre3:
----------------

View File

@ -746,23 +746,23 @@ static inline void
register_autocreated_options(void)
{
/* TODO: Use table-driven initialization. --jonas */
get_opt_int("terminal.linux.type", NULL) = 2;
get_opt_int("terminal.linux.colors", NULL) = 1;
get_opt_int("terminal.linux.type", NULL) = TERM_LINUX;
get_opt_int("terminal.linux.colors", NULL) = COLOR_MODE_16;
get_opt_bool("terminal.linux.m11_hack", NULL) = 1;
get_opt_int("terminal.vt100.type", NULL) = 1;
get_opt_int("terminal.vt110.type", NULL) = 1;
get_opt_int("terminal.xterm.type", NULL) = 1;
get_opt_int("terminal.vt100.type", NULL) = TERM_VT100;
get_opt_int("terminal.vt110.type", NULL) = TERM_VT100;
get_opt_int("terminal.xterm.type", NULL) = TERM_VT100;
get_opt_bool("terminal.xterm.underline", NULL) = 1;
get_opt_int("terminal.xterm-color.type", NULL) = 1;
get_opt_int("terminal.xterm-color.type", NULL) = TERM_VT100;
get_opt_int("terminal.xterm-color.colors", NULL) = COLOR_MODE_16;
get_opt_bool("terminal.xterm-color.underline", NULL) = 1;
#ifdef CONFIG_88_COLORS
get_opt_int("terminal.xterm-88color.type", NULL) = 1;
get_opt_int("terminal.xterm-88color.type", NULL) = TERM_VT100;
get_opt_int("terminal.xterm-88color.colors", NULL) = COLOR_MODE_88;
get_opt_bool("terminal.xterm-88color.underline", NULL) = 1;
#endif
#ifdef CONFIG_256_COLORS
get_opt_int("terminal.xterm-256color.type", NULL) = 1;
get_opt_int("terminal.xterm-256color.type", NULL) = TERM_VT100;
get_opt_int("terminal.xterm-256color.colors", NULL) = COLOR_MODE_256;
get_opt_bool("terminal.xterm-256color.underline", NULL) = 1;
#endif

View File

@ -233,6 +233,7 @@ get_dom_node_list_pos(struct dom_node_list *list, struct dom_node *node)
int i;
assert(list);
if_assert_failed return -1;
foreach_dom_node (list, entry, i) {
if (entry == node)
@ -247,7 +248,7 @@ get_dom_node_list_index(struct dom_node *parent, struct dom_node *node)
{
struct dom_node_list **list = get_dom_node_list(parent, node);
return list ? get_dom_node_list_pos(*list, node) : -1;
return (list && *list) ? get_dom_node_list_pos(*list, node) : -1;
}
struct dom_node *
@ -257,11 +258,20 @@ get_dom_node_prev(struct dom_node *node)
int index;
assert(node->parent);
if_assert_failed return NULL;
list = get_dom_node_list(node->parent, node);
/* node->parent != NULL, so the node must be in the
* appropriate list of the parent; the list thus cannot be
* empty. */
if (!list) return NULL;
assert(*list);
if_assert_failed return NULL;
index = get_dom_node_list_pos(*list, node);
assert(index >= 0); /* in particular, not -1 */
if_assert_failed return NULL;
if (index > 0)
return (*list)->entries[index - 1];
@ -275,11 +285,20 @@ get_dom_node_next(struct dom_node *node)
int index;
assert(node->parent);
if_assert_failed return NULL;
list = get_dom_node_list(node->parent, node);
/* node->parent != NULL, so the node must be in the
* appropriate list of the parent; the list thus cannot be
* empty. */
if (!list) return NULL;
assert(*list);
if_assert_failed return NULL;
index = get_dom_node_list_pos(*list, node);
assert(index >= 0); /* in particular, not -1 */
if_assert_failed return NULL;
if (index + 1 < (*list)->size)
return (*list)->entries[index + 1];
@ -295,7 +314,8 @@ get_dom_node_child(struct dom_node *parent, enum dom_node_type type,
int index;
list = get_dom_node_list_by_type(parent, type);
if (!list) return NULL;
if (!list) return NULL; /* parent doesn't support this type */
if (!*list) return NULL; /* list is empty and not yet allocated */
foreach_dom_node (*list, node, index) {
if (node->type != type)

View File

@ -408,8 +408,28 @@ struct dom_string *get_dom_node_value(struct dom_node *node);
/* Returns the name used for identifying the node type. */
struct dom_string *get_dom_node_type_name(enum dom_node_type type);
/* Based on the type of the parent and the node type return a proper list
* or NULL. This is useful when adding a node to a parent node. */
/** Based on the type of the @a parent and the node @a type return a
* proper list or NULL. This is useful when adding a node to a parent
* node.
*
* With a <code>struct dom_node_list **list</code> returned by this
* function, there are four possibilities:
*
* - <code>list == NULL</code>. This means @a parent does not support
* child nodes of the given @a type.
*
* - <code>*list == NULL</code>. This means @a parent does not yet
* have any child nodes of the given @a type and so no list has been
* allocated for them. Callers should treat the lack of a list in
* the same way as an empty list.
*
* - <code>(*list)->size == 0</code>. This is an empty list. It is
* unspecified whether the DOM code keeps such lists; it could
* instead change them back to NULL.
*
* - <code>(*list)->size != 0</code>. This is a nonempty list.
* However, the nodes in it might not actually be of the given
* @a type because some lists are used for multiple types. */
static inline struct dom_node_list **
get_dom_node_list_by_type(struct dom_node *parent, enum dom_node_type type)
{

View File

@ -301,10 +301,7 @@ globhist_simple_search(unsigned char *search_url, unsigned char *search_title)
/* Memorize last searched url */
mem_free_set(&gh_last_searched_url, stracpy(search_url));
if (!gh_last_searched_url) {
mem_free(gh_last_searched_title);
return 0;
}
if (!gh_last_searched_url) return 0;
if (!*search_title && !*search_url) {
/* No search terms, make all entries visible. */