From: Benno Schulenberg Date: Fri, 26 Feb 2016 20:09:29 +0000 (+0000) Subject: Renaming a struct element for aptness and contrast. X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3522751c6b3a30abd8a4b12107203270490099a8;p=nano.git Renaming a struct element for aptness and contrast. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5689 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 045f8725..c65439c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ * src/color.c (found_in_list): Factor out this triple repetition. * src/color.c (color_update): Rename a variable for conciseness. * src/color.c (nfreeregex): Elide this function, now used just once. + * src/nano.h: Rename a struct element for aptness and contrast. GNU nano 2.5.3 - 2016.02.25 diff --git a/src/color.c b/src/color.c index 542ed76c..f1f6a351 100644 --- a/src/color.c +++ b/src/color.c @@ -151,7 +151,7 @@ bool found_in_list(regexlisttype *head, const char *shibboleth) if (not_compiled) { item->ext = (regex_t *)nmalloc(sizeof(regex_t)); - regcomp(item->ext, fixbounds(item->ext_regex), REG_EXTENDED); + regcomp(item->ext, fixbounds(item->full_regex), REG_EXTENDED); } if (regexec(item->ext, shibboleth, 0, NULL, 0) == 0) diff --git a/src/global.c b/src/global.c index 06cde108..f31c2e3d 100644 --- a/src/global.c +++ b/src/global.c @@ -1626,7 +1626,7 @@ int strtomenu(const char *input) #ifndef DISABLE_COLOR void free_list_item(regexlisttype *dropit) { - free(dropit->ext_regex); + free(dropit->full_regex); if (dropit->ext != NULL) regfree(dropit->ext); free(dropit->ext); diff --git a/src/nano.h b/src/nano.h index 0099c37d..034cd13b 100644 --- a/src/nano.h +++ b/src/nano.h @@ -229,8 +229,8 @@ typedef struct colortype { } colortype; typedef struct regexlisttype { - char *ext_regex; - /* The regexstrings for the things that match this syntax. */ + char *full_regex; + /* A regex string to match things that imply a certain syntax. */ regex_t *ext; /* The compiled regexes. */ struct regexlisttype *next; diff --git a/src/rcfile.c b/src/rcfile.c index db1a129a..1b4d19e6 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -374,7 +374,7 @@ void parse_syntax(char *ptr) /* Save the extension regex if it's valid. */ if (nregcomp(fileregptr, REG_NOSUB)) { - newext->ext_regex = mallocstrcpy(NULL, fileregptr); + newext->full_regex = mallocstrcpy(NULL, fileregptr); newext->ext = NULL; if (endext == NULL) @@ -895,7 +895,7 @@ void parse_header_exp(char *ptr) /* Save the regex string if it's valid. */ if (nregcomp(regexstring, 0)) { - newheader->ext_regex = mallocstrcpy(NULL, regexstring); + newheader->full_regex = mallocstrcpy(NULL, regexstring); newheader->ext = NULL; if (endheader == NULL) @@ -960,7 +960,7 @@ void parse_magic_exp(char *ptr) /* Save the regex string if it's valid. */ if (nregcomp(regexstring, REG_NOSUB)) { - newmagic->ext_regex = mallocstrcpy(NULL, regexstring); + newmagic->full_regex = mallocstrcpy(NULL, regexstring); newmagic->ext = NULL; if (endmagic == NULL)