Commit 5a584ccd authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

treat color syntax names case sensitively, for consistency with how

their filename regexes are treated


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2960 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 17 additions and 15 deletions
+17 -15
......@@ -59,16 +59,17 @@ CVS code -
thanks_for_all_the_fish(), nregcomp(), parse_syntax(), and
parse_colors(). (Brand Huntsman and DLR)
- Various other color fixes. Handle unspecified foreground
colors properly, flag duplicate syntax names as errors, don't
automatically reinitialize the displayed colors every time we
update the current buffer's colors (since the buffer may not
be displayed immediately), don't bother doing complete
refreshes of the screen when color support is enabled if
there's no regex associated with the current file, and rename
variable exttype->val to exttype->ext, for consistency.
Changes to do_colorinit() (renamed color_init()),
update_color() (renamed color_update()), write_file(),
do_input(), do_output(), and parse_syntax(). (DLR)
colors properly, treat syntax names case sensitively, flag
duplicate syntax names as errors, don't automatically
reinitialize the displayed colors every time we update the
current buffer's colors (since the buffer may not be displayed
immediately), don't bother doing complete refreshes of the
screen when color support is enabled if there's no regex
associated with the current file, and rename variable
exttype->val to exttype->ext, for consistency. Changes to
do_colorinit() (renamed color_init()), update_color() (renamed
color_update()), write_file(), do_input(), do_output(), and
parse_syntax(). (DLR)
- Simplify get_totals() to only get the total number of
characters, and eliminate dependence on its old ability to get
the total number of lines by renumber()ing when necessary and
......@@ -131,7 +132,7 @@ CVS code -
titlebar(), statusbar(), bottombars(), edit_refresh(),
do_yesno(), and do_help(). (DLR)
- color.c:
- Remove unneeded string.h and fcntl.h includes. (DLR)
- Remove unneeded fcntl.h include. (DLR)
- chars.c:
mbrep()
- New function, the equivalent of control_mbrep() for non-control
......
......@@ -25,6 +25,7 @@
#endif
#include <stdio.h>
#include <string.h>
#include "proto.h"
#ifdef ENABLE_COLOR
......@@ -118,7 +119,7 @@ void color_update(void)
if (syntaxstr != NULL) {
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
tmpsyntax = tmpsyntax->next) {
if (mbstrcasecmp(tmpsyntax->desc, syntaxstr) == 0)
if (strcmp(tmpsyntax->desc, syntaxstr) == 0)
openfile->colorstrings = tmpsyntax->color;
if (openfile->colorstrings != NULL)
......@@ -138,7 +139,7 @@ void color_update(void)
* extensions. (We've checked for this and for duplicate
* syntax names elsewhere.) Skip over it here, but keep
* track of its color regexes. */
if (mbstrcasecmp(tmpsyntax->desc, "default") == 0) {
if (strcmp(tmpsyntax->desc, "default") == 0) {
defcolor = syntaxes->color;
continue;
}
......
......@@ -295,7 +295,7 @@ void parse_syntax(char *ptr)
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
tmpsyntax = tmpsyntax->next) {
if (mbstrcasecmp(nameptr, tmpsyntax->desc) == 0) {
if (strcmp(nameptr, tmpsyntax->desc) == 0) {
rcfile_error(N_("Duplicate syntax name %s"), nameptr);
return;
}
......@@ -323,7 +323,7 @@ void parse_syntax(char *ptr)
#endif
/* The default syntax should have no associated extensions. */
if (mbstrcasecmp(endsyntax->desc, "default") == 0 && *ptr != '\0') {
if (strcmp(endsyntax->desc, "default") == 0 && *ptr != '\0') {
rcfile_error(N_("The default syntax must take no extensions"));
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment