From 923a90cba057e840768a00324843578065e883db Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 31 May 2019 12:16:55 +0200 Subject: [PATCH] tweaks: rename a type, for more contrast --- src/nano.h | 8 ++++---- src/rcfile.c | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/nano.h b/src/nano.h index 9e144620..e35e76ed 100644 --- a/src/nano.h +++ b/src/nano.h @@ -217,23 +217,23 @@ typedef struct regexlisttype { /* The next regex. */ } regexlisttype; -typedef struct extendsyntaxstruct { +typedef struct augmentstruct { char *filename; /* The file where the syntax is extended. */ ssize_t lineno; /* The number of the line of the extendsyntax command. */ char *data; /* The text of the line. */ - struct extendsyntaxstruct *next; + struct augmentstruct *next; /* Next node. */ -} extendsyntaxstruct; +} augmentstruct; typedef struct syntaxtype { char *name; /* The name of this syntax. */ char *filename; /* File where the syntax is defined, or NULL if not an included file. */ - struct extendsyntaxstruct *extendsyntax; + struct augmentstruct *extendsyntax; /* List of extendsyntax commands to apply when loaded. */ regexlisttype *extensions; /* The list of extensions that this syntax applies to. */ diff --git a/src/rcfile.c b/src/rcfile.c index 330fb253..48c27779 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -582,11 +582,11 @@ void parse_one_include(char *file, syntaxtype *syntax) while (lastcolor->next != NULL) lastcolor = lastcolor->next; - extendsyntaxstruct *es = syntax->extendsyntax; + augmentstruct *es = syntax->extendsyntax; /* Apply any stored extendsyntax commands. */ while (es != NULL) { - extendsyntaxstruct *next = es->next; + augmentstruct *next = es->next; char *keyword = es->data, *ptr = parse_next_word(es->data); nanorc = es->filename; @@ -1049,7 +1049,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only) /* When the syntax isn't loaded yet, store extendsyntax commands. */ if (sint->filename != NULL) { - extendsyntaxstruct *newextendsyntax = nmalloc(sizeof(extendsyntaxstruct));; + augmentstruct *newextendsyntax = nmalloc(sizeof(augmentstruct));; newextendsyntax->filename = strdup(nanorc); newextendsyntax->lineno = lineno; @@ -1057,7 +1057,8 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only) newextendsyntax->next = NULL; if (sint->extendsyntax != NULL) { - extendsyntaxstruct *es = sint->extendsyntax; + augmentstruct *es = sint->extendsyntax; + while (es->next != NULL) es = es->next; es->next = newextendsyntax;