From: Benno Schulenberg Date: Mon, 29 Feb 2016 09:17:03 +0000 (+0000) Subject: Renaming a struct member. X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a24aee417dde3272023701c670a5047432992ee3;p=nano.git Renaming a struct member. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5697 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index b40e7acb..d4fa8167 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2016-02-28 Benno Schulenberg + * src/nano.h, src/rcfile.c, src/color.c: Rename a struct member. + 2016-02-28 Benno Schulenberg * 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 eea26e16..0e51fb2b 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 8303d4fc..72389213 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 5f8eeb4d..cef9167a 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 a020dcee..bf3bc9de 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;