mirror of git://git.sv.gnu.org/nano.git
rcfile: explicitly check for disallowed keywords in included files
This fixes https://savannah.gnu.org/bugs/?54441.
This commit is contained in:
parent
ac102a7516
commit
157c7b1bc4
|
@ -928,7 +928,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
|
|||
|
||||
#ifdef ENABLE_COLOR
|
||||
/* Handle extending first... */
|
||||
if (strcasecmp(keyword, "extendsyntax") == 0) {
|
||||
if (strcasecmp(keyword, "extendsyntax") == 0 && !syntax_only) {
|
||||
syntaxtype *sint;
|
||||
char *syntaxname = ptr;
|
||||
|
||||
|
@ -991,7 +991,12 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
|
|||
#else
|
||||
;
|
||||
#endif
|
||||
else if (syntax_only)
|
||||
else if (syntax_only && (strcasecmp(keyword, "set") == 0 ||
|
||||
strcasecmp(keyword, "unset") == 0 ||
|
||||
strcasecmp(keyword, "bind") == 0 ||
|
||||
strcasecmp(keyword, "unbind") == 0 ||
|
||||
strcasecmp(keyword, "include") == 0 ||
|
||||
strcasecmp(keyword, "extendsyntax") == 0))
|
||||
rcfile_error(N_("Command \"%s\" not allowed in included file"),
|
||||
keyword);
|
||||
else if (strcasecmp(keyword, "include") == 0)
|
||||
|
|
Loading…
Reference in New Issue