mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
bug 1084: Allow '+' and '*' in names in option manager
ELinks already allowed '+' and '*' in the names of options when reading a configuration file. The option manager however didn't let the user add such options. Allow the characters there too. These characters are needed especially in the mime.type tree, where '*' is used as a replacement for '.'. For example: set mime.type.audio.prs*sid = "sid" set mime.type.application.atom+xml = "atom" This commit changes one gettextised string.
This commit is contained in:
parent
67ffde03ba
commit
064ff3921d
2
NEWS
2
NEWS
@ -14,6 +14,8 @@ To be released as 0.12pre6 or 0.12rc1.
|
|||||||
systems.
|
systems.
|
||||||
* bug 983: Give preference to the Content-Type specified in the HTTP
|
* bug 983: Give preference to the Content-Type specified in the HTTP
|
||||||
header over that specified via the HTML meta tag.
|
header over that specified via the HTML meta tag.
|
||||||
|
* bug 1084: Allow option names containing '+' and '*' in the option
|
||||||
|
manager.
|
||||||
|
|
||||||
Bugs that should be removed from NEWS before the 0.12.0 release:
|
Bugs that should be removed from NEWS before the 0.12.0 release:
|
||||||
|
|
||||||
|
@ -208,8 +208,8 @@ parse_set(struct option *opt_tree, struct conf_parsing_state *state,
|
|||||||
|
|
||||||
/* Option name */
|
/* Option name */
|
||||||
optname_orig = state->pos.look;
|
optname_orig = state->pos.look;
|
||||||
while (isident(*state->pos.look) || *state->pos.look == '*'
|
while (is_option_name_char(*state->pos.look)
|
||||||
|| *state->pos.look == '.' || *state->pos.look == '+')
|
|| *state->pos.look == '.')
|
||||||
state->pos.look++;
|
state->pos.look++;
|
||||||
optname_len = state->pos.look - optname_orig;
|
optname_len = state->pos.look - optname_orig;
|
||||||
|
|
||||||
@ -341,8 +341,8 @@ parse_unset(struct option *opt_tree, struct conf_parsing_state *state,
|
|||||||
|
|
||||||
/* Option name */
|
/* Option name */
|
||||||
optname_orig = state->pos.look;
|
optname_orig = state->pos.look;
|
||||||
while (isident(*state->pos.look) || *state->pos.look == '*'
|
while (is_option_name_char(*state->pos.look)
|
||||||
|| *state->pos.look == '.' || *state->pos.look == '+')
|
|| *state->pos.look == '.')
|
||||||
state->pos.look++;
|
state->pos.look++;
|
||||||
optname_len = state->pos.look - optname_orig;
|
optname_len = state->pos.look - optname_orig;
|
||||||
|
|
||||||
|
@ -425,13 +425,11 @@ check_option_name(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
|||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
|
|
||||||
for (p = widget_data->cdata; *p; p++)
|
for (p = widget_data->cdata; *p; p++)
|
||||||
/* Not '*' since it is used internally. */
|
if (!is_option_name_char(*p)) {
|
||||||
if (!isident(*p)) {
|
|
||||||
/* FIXME: Encode '.' into '*'? */
|
|
||||||
info_box(dlg_data->win->term, 0,
|
info_box(dlg_data->win->term, 0,
|
||||||
N_("Bad string"), ALIGN_CENTER,
|
N_("Bad string"), ALIGN_CENTER,
|
||||||
N_("Option names may only contain alpha-numeric characters\n"
|
N_("Option names may only contain alpha-numeric characters\n"
|
||||||
"in addition to '_' and '-'."));
|
"in addition to '_', '-', '+', and '*'."));
|
||||||
return EVENT_NOT_PROCESSED;
|
return EVENT_NOT_PROCESSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,6 +318,16 @@ extern struct option *add_opt(struct option *, unsigned char *, unsigned char *,
|
|||||||
unsigned char *, enum option_flags, enum option_type,
|
unsigned char *, enum option_flags, enum option_type,
|
||||||
long, long, longptr_T, unsigned char *);
|
long, long, longptr_T, unsigned char *);
|
||||||
|
|
||||||
|
/** Check whether the character @a c may be used in the name of an
|
||||||
|
* option. This does not allow the '.' used in multi-part names like
|
||||||
|
* "config.comments". If you want to allow that too, check for it
|
||||||
|
* separately.
|
||||||
|
*
|
||||||
|
* If you modify this, please update the error message in
|
||||||
|
* check_option_name(). */
|
||||||
|
#define is_option_name_char(c) (isasciialnum(c) || (c) == '_' \
|
||||||
|
|| (c) == '-' || (c) == '+' || (c) == '*')
|
||||||
|
|
||||||
/* Hack which permit to disable option descriptions, to reduce elinks binary size.
|
/* Hack which permit to disable option descriptions, to reduce elinks binary size.
|
||||||
* It may of some use for people wanting a very small static non-i18n elinks binary,
|
* It may of some use for people wanting a very small static non-i18n elinks binary,
|
||||||
* at time of writing gain is over 25Kbytes. --Zas */
|
* at time of writing gain is over 25Kbytes. --Zas */
|
||||||
|
Loading…
Reference in New Issue
Block a user