diff --git a/ChangeLog b/ChangeLog index b40e7acbe5ab0eed4779f82d3774c61c0024be83..d4fa81671d49e5d99ee8415568ca38e423570f49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2016-02-28 Benno Schulenberg <bensberg@justemail.net> + * src/nano.h, src/rcfile.c, src/color.c: Rename a struct member. + 2016-02-28 Benno Schulenberg <bensberg@justemail.net> * src/rcfile.c (parse_header_exp): Don't continue when something is wrong -- skip the rest of the line. This fixes Savannah bug #47289. diff --git a/src/color.c b/src/color.c index eea26e16589fccba4b75d65968abd7b09694361a..0e51fb2b24281c9a637f400fd819d69ed5956243 100644 --- a/src/color.c +++ b/src/color.c @@ -190,7 +190,7 @@ void color_update(void) return; for (sint = syntaxes; sint != NULL; sint = sint->next) { - if (strcmp(sint->desc, syntaxstr) == 0) { + if (strcmp(sint->name, syntaxstr) == 0) { openfile->syntax = sint; openfile->colorstrings = sint->color; } @@ -295,7 +295,7 @@ void color_update(void) /* If we didn't find any syntax yet, see if there is a default one. */ if (openfile->colorstrings == NULL) { for (sint = syntaxes; sint != NULL; sint = sint->next) { - if (strcmp(sint->desc, "default") == 0) { + if (strcmp(sint->name, "default") == 0) { openfile->syntax = sint; openfile->colorstrings = sint->color; break; diff --git a/src/global.c b/src/global.c index 8303d4fcf9b2718327cb7e02c8a979669556689e..7238921321f98c9471bf0cfcc3e9ed87cf18e73c 100644 --- a/src/global.c +++ b/src/global.c @@ -1680,7 +1680,7 @@ void thanks_for_all_the_fish(void) while (syntaxes != NULL) { syntaxtype *bill = syntaxes; - free(syntaxes->desc); + free(syntaxes->name); free(syntaxes->linter); free(syntaxes->formatter); diff --git a/src/nano.h b/src/nano.h index 5f8eeb4d61df25dc466e15c94eeda6a188ff8288..cef9167a71b10d655d2b927f65930e0026fe8084 100644 --- a/src/nano.h +++ b/src/nano.h @@ -238,7 +238,7 @@ typedef struct regexlisttype { } regexlisttype; typedef struct syntaxtype { - char *desc; + char *name; /* The name of this syntax. */ regexlisttype *extensions; /* The list of extensions that this syntax applies to. */ diff --git a/src/rcfile.c b/src/rcfile.c index a020dceeb60fa8f444db77476f81b5ba7e64fd80..bf3bc9de7f343d9f87532db000e33f3660a603da 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -299,7 +299,7 @@ void parse_syntax(char *ptr) prev_syntax = NULL; for (tmpsyntax = syntaxes; tmpsyntax != NULL; tmpsyntax = tmpsyntax->next) { - if (strcmp(nameptr, tmpsyntax->desc) == 0) { + if (strcmp(nameptr, tmpsyntax->name) == 0) { syntaxtype *old_syntax = tmpsyntax; if (endsyntax == tmpsyntax) @@ -311,7 +311,7 @@ void parse_syntax(char *ptr) else syntaxes = tmpsyntax; - free(old_syntax->desc); + free(old_syntax->name); free(old_syntax); break; } @@ -329,7 +329,7 @@ void parse_syntax(char *ptr) #endif } - endsyntax->desc = mallocstrcpy(NULL, nameptr); + endsyntax->name = mallocstrcpy(NULL, nameptr); endsyntax->color = NULL; endcolor = NULL; endsyntax->extensions = NULL; @@ -348,13 +348,13 @@ void parse_syntax(char *ptr) /* The "none" syntax is the same as not having a syntax at all, so * we can't assign any extensions or colors to it. */ - if (strcmp(endsyntax->desc, "none") == 0) { + if (strcmp(endsyntax->name, "none") == 0) { rcfile_error(N_("The \"none\" syntax is reserved")); return; } /* The default syntax should have no associated extensions. */ - if (strcmp(endsyntax->desc, "default") == 0 && *ptr != '\0') { + if (strcmp(endsyntax->name, "default") == 0 && *ptr != '\0') { rcfile_error( N_("The \"default\" syntax must take no extensions")); return; @@ -1062,7 +1062,7 @@ void parse_rcfile(FILE *rcstream ptr = parse_next_word(ptr); for (ts = syntaxes; ts != NULL; ts = ts->next) - if (!strcmp(ts->desc, syntaxname)) + if (!strcmp(ts->name, syntaxname)) break; if (ts == NULL) { @@ -1109,7 +1109,7 @@ void parse_rcfile(FILE *rcstream } else if (strcasecmp(keyword, "syntax") == 0) { if (endsyntax != NULL && endcolor == NULL) rcfile_error(N_("Syntax \"%s\" has no color commands"), - endsyntax->desc); + endsyntax->name); parse_syntax(ptr); } else if (strcasecmp(keyword, "magic") == 0) @@ -1318,7 +1318,7 @@ void parse_rcfile(FILE *rcstream #ifndef DISABLE_COLOR if (endsyntax != NULL && endcolor == NULL) rcfile_error(N_("Syntax \"%s\" has no color commands"), - endsyntax->desc); + endsyntax->name); #endif opensyntax = FALSE;