mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Merge commit 'origin/master'
This commit is contained in:
commit
04f1ecc3b5
@ -95,7 +95,7 @@ parse(void)
|
||||
space = strchr(current, ' ');
|
||||
if (!space)
|
||||
return;
|
||||
|
||||
|
||||
host = find(space + 1, "Host: ");
|
||||
if (!host)
|
||||
return;
|
||||
|
@ -142,7 +142,7 @@ parse_set_common(struct option *opt_tree, unsigned char **file, int *line,
|
||||
|
||||
if (want_domain && *domain_name) {
|
||||
struct option *domain_tree;
|
||||
|
||||
|
||||
domain_tree = get_domain_tree(domain_name);
|
||||
if (!domain_tree) {
|
||||
mem_free(domain_name);
|
||||
|
@ -270,6 +270,8 @@ html_skip(struct html_context *html_context, unsigned char *a)
|
||||
html_top->type = ELEMENT_DONT_KILL;
|
||||
}
|
||||
|
||||
#define LWS(c) ((c) == ' ' || (c) == ASCII_TAB)
|
||||
|
||||
/* Parse meta refresh without URL= in it:
|
||||
* <meta http-equiv="refresh" content="3,http://elinks.or.cz/">
|
||||
* <meta http-equiv="refresh" content="3; http://elinks.or.cz/">
|
||||
@ -285,18 +287,18 @@ parse_old_meta_refresh(unsigned char *str, unsigned char **ret)
|
||||
if_assert_failed return;
|
||||
|
||||
*ret = NULL;
|
||||
while (*p && (*p == ' ' || *p == ASCII_TAB)) p++;
|
||||
while (*p && LWS(*p)) p++;
|
||||
if (!*p) return;
|
||||
while (*p && *p >= '0' && *p <= '9') p++;
|
||||
if (!*p) return;
|
||||
while (*p && (*p == ' ' || *p == ASCII_TAB)) p++;
|
||||
while (*p && LWS(*p)) p++;
|
||||
if (!*p) return;
|
||||
if (*p == ';' || *p == ',') p++; else return;
|
||||
while (*p && (*p == ' ' || *p == ASCII_TAB)) p++;
|
||||
while (*p && LWS(*p)) p++;
|
||||
if (!*p) return;
|
||||
|
||||
len = strlen(p);
|
||||
while (len && (p[len] == ' ' || p[len] == ASCII_TAB)) len--;
|
||||
while (len && LWS(p[len])) len--;
|
||||
if (len) *ret = memacpy(p, len);
|
||||
}
|
||||
|
||||
@ -321,7 +323,6 @@ parse_old_meta_refresh(unsigned char *str, unsigned char **ret)
|
||||
static enum parse_header_param
|
||||
search_for_url_param(unsigned char *str, unsigned char **ret)
|
||||
{
|
||||
#define LWS(c) ((c) == ' ' || (c) == ASCII_TAB)
|
||||
unsigned char *p;
|
||||
int plen = 0;
|
||||
|
||||
@ -372,9 +373,10 @@ search_for_url_param(unsigned char *str, unsigned char **ret)
|
||||
return HEADER_PARAM_OUT_OF_MEMORY;
|
||||
}
|
||||
return HEADER_PARAM_FOUND;
|
||||
#undef LWS
|
||||
}
|
||||
|
||||
#undef LWS
|
||||
|
||||
static void
|
||||
check_head_for_refresh(struct html_context *html_context, unsigned char *head)
|
||||
{
|
||||
|
@ -151,8 +151,9 @@ html_stack_dup(struct html_context *html_context, enum html_element_mortality_ty
|
||||
if (ep->attr.title) e->attr.title = stracpy(ep->attr.title);
|
||||
if (ep->attr.select) e->attr.select = stracpy(ep->attr.select);
|
||||
|
||||
#ifdef CONFIG_CSS
|
||||
e->attr.id = e->attr.class = NULL;
|
||||
|
||||
#endif
|
||||
/* We don't want to propagate these. */
|
||||
/* XXX: For sure? --pasky */
|
||||
e->attr.onclick = e->attr.ondblclick = e->attr.onmouseover = e->attr.onhover
|
||||
|
@ -2064,10 +2064,10 @@ format_html_part(struct html_context *html_context,
|
||||
{
|
||||
struct part *part;
|
||||
void *html_state;
|
||||
int llm = renderer_context.last_link_to_move;
|
||||
struct tag *ltm = renderer_context.last_tag_to_move;
|
||||
int ef = renderer_context.empty_format;
|
||||
int lm = html_context->margin;
|
||||
struct tag *saved_last_tag_to_move = renderer_context.last_tag_to_move;
|
||||
int saved_empty_format = renderer_context.empty_format;
|
||||
int saved_margin = html_context->margin;
|
||||
int saved_last_link_to_move = renderer_context.last_link_to_move;
|
||||
|
||||
/* Hash creation if needed. */
|
||||
if (!table_cache) {
|
||||
@ -2163,11 +2163,11 @@ format_html_part(struct html_context *html_context,
|
||||
}
|
||||
|
||||
ret:
|
||||
renderer_context.last_link_to_move = llm;
|
||||
renderer_context.last_tag_to_move = ltm;
|
||||
renderer_context.empty_format = ef;
|
||||
renderer_context.last_link_to_move = saved_last_link_to_move;
|
||||
renderer_context.last_tag_to_move = saved_last_tag_to_move;
|
||||
renderer_context.empty_format = saved_empty_format;
|
||||
|
||||
html_context->margin = lm;
|
||||
html_context->margin = saved_margin;
|
||||
|
||||
if (html_context->table_level > 1 && !document
|
||||
&& table_cache
|
||||
@ -2176,30 +2176,27 @@ ret:
|
||||
/* Clear memory to prevent bad key comparaison due to alignment
|
||||
* of key fields. */
|
||||
struct table_cache_entry *tce = mem_calloc(1, sizeof(*tce));
|
||||
/* A goto is used here to prevent a test or code
|
||||
* redundancy. */
|
||||
if (!tce) goto end;
|
||||
|
||||
tce->key.start = start;
|
||||
tce->key.end = end;
|
||||
tce->key.align = align;
|
||||
tce->key.margin = margin;
|
||||
tce->key.width = width;
|
||||
tce->key.x = x;
|
||||
tce->key.link_num = link_num;
|
||||
copy_struct(&tce->part, part);
|
||||
if (tce) {
|
||||
tce->key.start = start;
|
||||
tce->key.end = end;
|
||||
tce->key.align = align;
|
||||
tce->key.margin = margin;
|
||||
tce->key.width = width;
|
||||
tce->key.x = x;
|
||||
tce->key.link_num = link_num;
|
||||
copy_struct(&tce->part, part);
|
||||
|
||||
if (!add_hash_item(table_cache,
|
||||
(unsigned char *) &tce->key,
|
||||
sizeof(tce->key), tce)) {
|
||||
mem_free(tce);
|
||||
} else {
|
||||
table_cache_entries++;
|
||||
if (!add_hash_item(table_cache,
|
||||
(unsigned char *) &tce->key,
|
||||
sizeof(tce->key), tce)) {
|
||||
mem_free(tce);
|
||||
} else {
|
||||
table_cache_entries++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
|
||||
return part;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ cache_entry_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
if (!JS_InstanceOf(ctx, obj, (JSClass *) &cache_entry_class, NULL))
|
||||
return JS_FALSE;
|
||||
|
||||
cached = JS_GetInstancePrivate(ctx, obj,
|
||||
cached = JS_GetInstancePrivate(ctx, obj,
|
||||
(JSClass *) &cache_entry_class, NULL);
|
||||
|
||||
if (!cache_entry_is_valid(cached)) return JS_FALSE;
|
||||
|
@ -54,7 +54,7 @@ struct screen_char {
|
||||
unsigned char color[SCREEN_COLOR_SIZE];
|
||||
};
|
||||
|
||||
/** @relates screen_char */
|
||||
/** @relates screen_char */
|
||||
#define copy_screen_chars(to, from, amount) \
|
||||
do { memcpy(to, from, (amount) * sizeof(struct screen_char)); } while (0)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/** Process' CPU time utilities
|
||||
/** Process' CPU time utilities
|
||||
* @file*/
|
||||
|
||||
#ifndef EL__UTIL_PROFILE_H
|
||||
|
Loading…
Reference in New Issue
Block a user