parse_argument()
- Rename variable ptr_bak to ptr_save, for consistency. (DLR)
parse_syntax()
- - Properly generate an error if we've read in a previous syntax
- without any associated color commands. (DLR)
- Don't generate an error if we find a duplicate syntax name,
since we might be trying to override a syntax in the global
nanorc with one in our local nanorc. Instead, free any
assert(ptr != NULL);
- if (endsyntax != NULL && endcolor == NULL) {
- rcfile_error(N_("Previous syntax has no color commands"));
- return;
- }
-
if (*ptr == '\0') {
rcfile_error(N_("Missing syntax name"));
return;
keyword);
else
parse_include(ptr);
- } else if (strcasecmp(keyword, "syntax") == 0)
+ } else if (strcasecmp(keyword, "syntax") == 0) {
+ if (endsyntax != NULL && endcolor == NULL)
+ rcfile_error(
+ N_("Previous syntax has no color commands"));
parse_syntax(ptr);
- else if (strcasecmp(keyword, "color") == 0)
+ } else if (strcasecmp(keyword, "color") == 0)
parse_colors(ptr, FALSE);
else if (strcasecmp(keyword, "icolor") == 0)
parse_colors(ptr, TRUE);