1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00

Merge with git+ssh://pasky/srv/git/elinks.git

This commit is contained in:
Jonas Fonseca 2006-12-10 18:24:58 +01:00
commit b527fcb308
6 changed files with 42 additions and 4 deletions

View File

@ -835,7 +835,7 @@ save_cookies(struct terminal *term) {
time_t now; time_t now;
#ifdef CONFIG_SMALL #ifdef CONFIG_SMALL
# define CANNOT_SAVE_COOKIES(message) # define CANNOT_SAVE_COOKIES(flags, message)
#else #else
# define CANNOT_SAVE_COOKIES(flags, message) \ # define CANNOT_SAVE_COOKIES(flags, message) \
do { \ do { \

View File

@ -66,7 +66,8 @@ struct html_context {
* state-machine. */ * state-machine. */
int was_li; int was_li;
int quote_level; /* Nesting level of <q> tags. */ unsigned int quote_level; /* Nesting level of <q> tags. See @html_quote
* for why this is unsigned. */
unsigned int was_br:1; unsigned int was_br:1;
unsigned int was_xmp:1; unsigned int was_xmp:1;

View File

@ -104,6 +104,14 @@ void
html_quote(struct html_context *html_context, unsigned char *a, html_quote(struct html_context *html_context, unsigned char *a,
unsigned char *xxx3, unsigned char *xxx4, unsigned char **xxx5) unsigned char *xxx3, unsigned char *xxx4, unsigned char **xxx5)
{ {
/* An HTML document containing extremely many repetitions of
* "<q>" could cause @html_context->quote_level to overflow.
* Because it is unsigned, it then wraps around to zero, and
* we don't get a negative array index here. If the document
* then tries to close the quotes with "</q>", @html_quote_close
* won't let the quote level wrap back, so it will render the
* quotes incorrectly, but such a document probably doesn't
* make sense anyway. */
unsigned char *q = quote_char[html_context->quote_level++ % 2]; unsigned char *q = quote_char[html_context->quote_level++ % 2];
put_chrs(html_context, q, 1); put_chrs(html_context, q, 1);

View File

@ -0,0 +1,18 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <see/see.h>
#include "ecmascript/see/checktype.h"
void
see_check_class(struct SEE_interpreter *interp,
const struct SEE_object *object,
const struct SEE_objectclass *class)
{
if (object->objectclass != class)
SEE_error_throw(interp, interp->TypeError,
"got %s, expected %s",
object->objectclass->Class,
class->Class);
}

View File

@ -0,0 +1,12 @@
#ifndef EL__ECMASCRIPT_SEE_CHECKTYPE_H
#define EL__ECMASCRIPT_SEE_CHECKTYPE_H
struct SEE_interpreter;
struct SEE_object;
struct SEE_objectclass;
void see_check_class(struct SEE_interpreter *interp,
const struct SEE_object *object,
const struct SEE_objectclass *class);
#endif

View File

@ -94,13 +94,12 @@ about_protocol_handler(struct connection *conn)
/* Only do this the first time */ /* Only do this the first time */
if (cached && !cached->content_type) { if (cached && !cached->content_type) {
int len = 0;
#ifndef CONFIG_SMALL #ifndef CONFIG_SMALL
{ {
const struct about_page *page = about_pages; const struct about_page *page = about_pages;
for (; page->name; page++) { for (; page->name; page++) {
int len;
unsigned char *str; unsigned char *str;
if (strcmp(conn->uri->data, page->name)) if (strcmp(conn->uri->data, page->name))