Not accepting 'header" and 'magic' commands for the default syntax.
This fixes Savannah bug #47323. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5713 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
2f63e8dfc1
commit
2994ea9d02
|
@ -1,3 +1,7 @@
|
||||||
|
2016-03-10 Benno Schulenberg <bensberg@justemail.net>
|
||||||
|
* src/rcfile.c (grab_and_store): Do not accept 'header" and 'magic'
|
||||||
|
commands for the default syntax. This fixes Savannah bug #47323.
|
||||||
|
|
||||||
2016-03-09 Benno Schulenberg <bensberg@justemail.net>
|
2016-03-09 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/rcfile.c (parse_syntax): Produce an adequate error message
|
* src/rcfile.c (parse_syntax): Produce an adequate error message
|
||||||
when the syntax name is unquoted. This fixes Savannah bug #47324.
|
when the syntax name is unquoted. This fixes Savannah bug #47324.
|
||||||
|
|
|
@ -329,7 +329,7 @@ void parse_syntax(char *ptr)
|
||||||
/* The default syntax should have no associated extensions. */
|
/* The default syntax should have no associated extensions. */
|
||||||
if (strcmp(endsyntax->name, "default") == 0 && *ptr != '\0') {
|
if (strcmp(endsyntax->name, "default") == 0 && *ptr != '\0') {
|
||||||
rcfile_error(
|
rcfile_error(
|
||||||
N_("The \"default\" syntax must take no extensions"));
|
N_("The \"default\" syntax does not accept extensions"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -805,6 +805,13 @@ void grab_and_store(char *ptr, const char *kind, regexlisttype **storage)
|
||||||
{
|
{
|
||||||
regexlisttype *lastthing;
|
regexlisttype *lastthing;
|
||||||
|
|
||||||
|
/* The default syntax doesn't take any file matching stuff. */
|
||||||
|
if (strcmp(endsyntax->name, "default") == 0 && *ptr != '\0') {
|
||||||
|
rcfile_error(
|
||||||
|
N_("The \"default\" syntax does not accept '%s' regexes"), kind);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!opensyntax) {
|
if (!opensyntax) {
|
||||||
rcfile_error(
|
rcfile_error(
|
||||||
N_("A '%s' command requires a preceding 'syntax' command"), kind);
|
N_("A '%s' command requires a preceding 'syntax' command"), kind);
|
||||||
|
|
Loading…
Reference in New Issue