]> git.wh0rd.org Git - nano.git/commitdiff
Renaming a variable and fusing an increment.
authorBenno Schulenberg <bensberg@justemail.net>
Sun, 28 Feb 2016 15:47:37 +0000 (15:47 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Sun, 28 Feb 2016 15:47:37 +0000 (15:47 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5693 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/rcfile.c

index 7f416196b12a0c1edd70152e3f597fdde95aec04..ae6b507d77f899b807948b38c6bac25741e13514 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
        * src/rcfile.c (parse_header_exp, parse_magic_exp, grab_and_store):
        Use the now correct parsing of header regexes also for parsing magic
        regexes.  This fixes Savannah bug #47292 and saves 50 lines of code.
+       * src/rcfile.c (grab_and_store): Rename a variable and densify.
 
 2016-02-26  Benno Schulenberg  <bensberg@justemail.net>
        * doc/man/nanorc.5, doc/texinfo/nano.texi, doc/syntax/nanorc.nanorc,
index de48ad6f120c7117bbd6012eb26c3a22bcfc2d7e..073615e5a6054f3f40e71a2da7facd75a29fbe98 100644 (file)
@@ -876,7 +876,7 @@ void grab_and_store(char *ptr, const char *kind, regexlisttype **storage)
     /* Now load the regexes into their part of the struct. */
     while (*ptr != '\0') {
        const char *regexstring;
-       regexlisttype *newheader;
+       regexlisttype *newthing;
 
        if (*ptr != '"') {
            rcfile_error(
@@ -884,28 +884,27 @@ void grab_and_store(char *ptr, const char *kind, regexlisttype **storage)
            return;
        }
 
-       ptr++;
-
-       regexstring = ptr;
+       regexstring = ++ptr;
        ptr = parse_next_regex(ptr);
        if (ptr == NULL)
-           break;
+           return;
 
-       newheader = (regexlisttype *)nmalloc(sizeof(regexlisttype));
+       newthing = (regexlisttype *)nmalloc(sizeof(regexlisttype));
 
        /* Save the regex string if it's valid. */
        if (nregcomp(regexstring, REG_NOSUB)) {
-           newheader->full_regex = mallocstrcpy(NULL, regexstring);
-           newheader->rgx = NULL;
+           newthing->full_regex = mallocstrcpy(NULL, regexstring);
+           newthing->rgx = NULL;
 
            if (lastthing == NULL)
-               *storage = newheader;
+               *storage = newthing;
            else
-               lastthing->next = newheader;
-           lastthing = newheader;
+               lastthing->next = newthing;
+
+           lastthing = newthing;
            lastthing->next = NULL;
        } else
-           free(newheader);
+           free(newthing);
     }
 }