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
master
Benno Schulenberg 2016-02-26 20:09:29 +00:00
parent 2134212fa9
commit 3522751c6b
5 changed files with 8 additions and 7 deletions

View File

@ -8,6 +8,7 @@
* src/color.c (found_in_list): Factor out this triple repetition. * src/color.c (found_in_list): Factor out this triple repetition.
* src/color.c (color_update): Rename a variable for conciseness. * src/color.c (color_update): Rename a variable for conciseness.
* src/color.c (nfreeregex): Elide this function, now used just once. * 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 GNU nano 2.5.3 - 2016.02.25

View File

@ -151,7 +151,7 @@ bool found_in_list(regexlisttype *head, const char *shibboleth)
if (not_compiled) { if (not_compiled) {
item->ext = (regex_t *)nmalloc(sizeof(regex_t)); 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) if (regexec(item->ext, shibboleth, 0, NULL, 0) == 0)

View File

@ -1626,7 +1626,7 @@ int strtomenu(const char *input)
#ifndef DISABLE_COLOR #ifndef DISABLE_COLOR
void free_list_item(regexlisttype *dropit) void free_list_item(regexlisttype *dropit)
{ {
free(dropit->ext_regex); free(dropit->full_regex);
if (dropit->ext != NULL) if (dropit->ext != NULL)
regfree(dropit->ext); regfree(dropit->ext);
free(dropit->ext); free(dropit->ext);

View File

@ -229,8 +229,8 @@ typedef struct colortype {
} colortype; } colortype;
typedef struct regexlisttype { typedef struct regexlisttype {
char *ext_regex; char *full_regex;
/* The regexstrings for the things that match this syntax. */ /* A regex string to match things that imply a certain syntax. */
regex_t *ext; regex_t *ext;
/* The compiled regexes. */ /* The compiled regexes. */
struct regexlisttype *next; struct regexlisttype *next;

View File

@ -374,7 +374,7 @@ void parse_syntax(char *ptr)
/* Save the extension regex if it's valid. */ /* Save the extension regex if it's valid. */
if (nregcomp(fileregptr, REG_NOSUB)) { if (nregcomp(fileregptr, REG_NOSUB)) {
newext->ext_regex = mallocstrcpy(NULL, fileregptr); newext->full_regex = mallocstrcpy(NULL, fileregptr);
newext->ext = NULL; newext->ext = NULL;
if (endext == NULL) if (endext == NULL)
@ -895,7 +895,7 @@ void parse_header_exp(char *ptr)
/* Save the regex string if it's valid. */ /* Save the regex string if it's valid. */
if (nregcomp(regexstring, 0)) { if (nregcomp(regexstring, 0)) {
newheader->ext_regex = mallocstrcpy(NULL, regexstring); newheader->full_regex = mallocstrcpy(NULL, regexstring);
newheader->ext = NULL; newheader->ext = NULL;
if (endheader == NULL) if (endheader == NULL)
@ -960,7 +960,7 @@ void parse_magic_exp(char *ptr)
/* Save the regex string if it's valid. */ /* Save the regex string if it's valid. */
if (nregcomp(regexstring, REG_NOSUB)) { if (nregcomp(regexstring, REG_NOSUB)) {
newmagic->ext_regex = mallocstrcpy(NULL, regexstring); newmagic->full_regex = mallocstrcpy(NULL, regexstring);
newmagic->ext = NULL; newmagic->ext = NULL;
if (endmagic == NULL) if (endmagic == NULL)