Commit 3522751c authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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
No related merge requests found
Showing with 8 additions and 7 deletions
+8 -7
......@@ -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
......
......@@ -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)
......
......@@ -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);
......
......@@ -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;
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment