From: David Lawrence Ramsey Date: Mon, 1 Aug 2005 04:34:27 +0000 (+0000) Subject: treat color syntax names case sensitively, for consistency with how X-Git-Tag: v1.3.9~86 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5a584ccda333ab96f3d460857ee06914aad3ddeb;p=nano.git 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 --- diff --git a/ChangeLog b/ChangeLog index 875e3bab..6320d6c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/src/color.c b/src/color.c index 658a81da..24482f80 100644 --- a/src/color.c +++ b/src/color.c @@ -25,6 +25,7 @@ #endif #include +#include #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; } diff --git a/src/rcfile.c b/src/rcfile.c index 2f0f9801..c628efca 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -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; }