mirror of
https://github.com/rkd77/elinks.git
synced 2024-08-25 21:44:47 -04:00
Merge with master
This commit is contained in:
commit
c83fd84900
@ -497,6 +497,9 @@ Use assert() and assertm() where applicable. It will prevent hidden bugs.
|
||||
|
||||
Names of enum constants should be in upper case.
|
||||
|
||||
Please call the charset "utf8" or "UTF8" in identifiers, "UTF-8"
|
||||
elsewhere, and "utf_8" only for compatibility.
|
||||
|
||||
If you see code in ELinks that doesn't follow these rules, fix it or tell us
|
||||
about it.
|
||||
|
||||
|
@ -885,14 +885,16 @@ static struct option_info config_options_info[] = {
|
||||
"and lines working at the same time. Makes sense only with linux\n"
|
||||
"terminal.")),
|
||||
|
||||
/* When CONFIG_UTF8 is defined, any code that reads the "utf_8_io"
|
||||
* option should also check whether the "codepage" option is UTF-8,
|
||||
* and if so, behave as if "utf_8_io" were 1. (When CONFIG_UTF8 is
|
||||
* not defined, it should not be possible to set UTF-8 as "codepage";
|
||||
* please report any such possibilities as bugs.) */
|
||||
INIT_OPT_BOOL("terminal._template_", N_("UTF-8 I/O"),
|
||||
"utf_8_io", 0, 0,
|
||||
N_("Enable I/O in UTF-8 for Unicode terminals. Note that currently,\n"
|
||||
"only the subset of UTF-8 according to terminal codepage is used.\n"
|
||||
"ELinks ignores this option if the terminal codepage is UTF-8.")),
|
||||
/* When CONFIG_UTF8 is defined, any code that reads the "utf_8_io"
|
||||
* option should also check whether the "codepage" option is UTF-8,
|
||||
* and if so, behave as if "utf_8_io" were 1. */
|
||||
|
||||
INIT_OPT_BOOL("terminal._template_", N_("Restrict frames in cp850/852"),
|
||||
"restrict_852", 0, 0,
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* Check the type of a SEE object so it's safe to cast */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -639,7 +639,7 @@ utf8_to_unicode(unsigned char **string, unsigned char *end)
|
||||
}
|
||||
|
||||
switch (length) {
|
||||
case 1:
|
||||
case 1: /* U+0000 to U+007F */
|
||||
if (str[0] >= 0x80) {
|
||||
invalid_utf8:
|
||||
++*string;
|
||||
@ -647,7 +647,7 @@ invalid_utf8:
|
||||
}
|
||||
u = str[0];
|
||||
break;
|
||||
case 2:
|
||||
case 2: /* U+0080 to U+07FF */
|
||||
if ((str[1] & 0xc0) != 0x80)
|
||||
goto invalid_utf8;
|
||||
u = (str[0] & 0x1f) << 6;
|
||||
@ -655,16 +655,16 @@ invalid_utf8:
|
||||
if (u < 0x80)
|
||||
goto invalid_utf8;
|
||||
break;
|
||||
case 3:
|
||||
case 3: /* U+0800 to U+FFFF, except surrogates */
|
||||
if ((str[1] & 0xc0) != 0x80 || (str[2] & 0xc0) != 0x80)
|
||||
goto invalid_utf8;
|
||||
u = (str[0] & 0x0f) << 12;
|
||||
u += ((str[1] & 0x3f) << 6);
|
||||
u += (str[2] & 0x3f);
|
||||
if (u < 0x800)
|
||||
if (u < 0x800 || is_utf16_surrogate(u))
|
||||
goto invalid_utf8;
|
||||
break;
|
||||
case 4:
|
||||
case 4: /* U+10000 to U+1FFFFF */
|
||||
if ((str[1] & 0xc0) != 0x80 || (str[2] & 0xc0) != 0x80
|
||||
|| (str[3] & 0xc0) != 0x80)
|
||||
goto invalid_utf8;
|
||||
@ -675,7 +675,7 @@ invalid_utf8:
|
||||
if (u < 0x10000)
|
||||
goto invalid_utf8;
|
||||
break;
|
||||
case 5:
|
||||
case 5: /* U+200000 to U+3FFFFFF */
|
||||
if ((str[1] & 0xc0) != 0x80 || (str[2] & 0xc0) != 0x80
|
||||
|| (str[3] & 0xc0) != 0x80 || (str[4] & 0xc0) != 0x80)
|
||||
goto invalid_utf8;
|
||||
@ -687,7 +687,7 @@ invalid_utf8:
|
||||
if (u < 0x200000)
|
||||
goto invalid_utf8;
|
||||
break;
|
||||
case 6:
|
||||
case 6: /* U+4000000 to U+7FFFFFFF */
|
||||
if ((str[1] & 0xc0) != 0x80 || (str[2] & 0xc0) != 0x80
|
||||
|| (str[3] & 0xc0) != 0x80 || (str[4] & 0xc0) != 0x80
|
||||
|| (str[5] & 0xc0) != 0x80)
|
||||
|
@ -1023,6 +1023,13 @@ activate_link(struct session *ses, struct document_view *doc_view,
|
||||
return FRAME_EVENT_REFRESH;
|
||||
}
|
||||
|
||||
/* @link_fc->type must be FC_RADIO, then. First turn
|
||||
* this one on, and then turn off all the other radio
|
||||
* buttons in the group. Do it in this order because
|
||||
* further @find_form_state calls may reallocate
|
||||
* @doc_view->vs->form_info[] and thereby make the @fs
|
||||
* pointer invalid. */
|
||||
fs->state = 1;
|
||||
foreach (form, doc_view->document->forms) {
|
||||
struct form_control *fc;
|
||||
|
||||
@ -1031,7 +1038,8 @@ activate_link(struct session *ses, struct document_view *doc_view,
|
||||
|
||||
foreach (fc, form->items) {
|
||||
if (fc->type == FC_RADIO
|
||||
&& !xstrcmp(fc->name, link_fc->name)) {
|
||||
&& !xstrcmp(fc->name, link_fc->name)
|
||||
&& fc != link_fc) {
|
||||
struct form_state *frm_st;
|
||||
|
||||
frm_st = find_form_state(doc_view, fc);
|
||||
@ -1039,7 +1047,6 @@ activate_link(struct session *ses, struct document_view *doc_view,
|
||||
}
|
||||
}
|
||||
}
|
||||
fs->state = 1;
|
||||
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user