nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 9b30bb15cc3bb18f3b4999f35736e73b8f3892f7
parent a1669e1bfdbfb547627375a92a880449f017514f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon,  3 Jun 2019 15:51:07 +0200

tweaks: adjust the indentation after the previous change

And reshuffle two declarations.

Diffstat:
Msrc/rcfile.c | 32++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -1022,8 +1022,9 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only) #ifdef ENABLE_COLOR /* Handle extending first... */ if (strcasecmp(keyword, "extendsyntax") == 0 && !syntax_only) { - syntaxtype *sint; + augmentstruct *newitem, *extra; char *syntaxname = ptr; + syntaxtype *sint; ptr = parse_next_word(ptr); @@ -1045,24 +1046,23 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only) continue; } - /* When the syntax isn't loaded yet, store extendsyntax commands. */ - augmentstruct *newitem = nmalloc(sizeof(augmentstruct));; - - newitem->filename = strdup(nanorc); - newitem->lineno = lineno; - newitem->data = strdup(ptr); - newitem->next = NULL; + newitem = nmalloc(sizeof(augmentstruct));; - if (sint->augmentations != NULL) { - augmentstruct *extra = sint->augmentations; + /* Store the content of an 'extendsyntax', for later parsing. */ + newitem->filename = strdup(nanorc); + newitem->lineno = lineno; + newitem->data = strdup(ptr); + newitem->next = NULL; - while (extra->next != NULL) - extra = extra->next; - extra->next = newitem; - } else - sint->augmentations = newitem; + if (sint->augmentations != NULL) { + extra = sint->augmentations; + while (extra->next != NULL) + extra = extra->next; + extra->next = newitem; + } else + sint->augmentations = newitem; - continue; + continue; } /* Try to parse the keyword. */