From ab73dd4816989a96d75813636dddd386522b05e1 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Fri, 29 Jul 2005 22:08:56 +0000
Subject: [PATCH] fix extension decompilation breakage

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2950 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 src/color.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/color.c b/src/color.c
index 496df03d..79073bf8 100644
--- a/src/color.c
+++ b/src/color.c
@@ -118,12 +118,12 @@ void color_update(void)
 	exttype *e;
 
 	for (e = tmpsyntax->extensions; e != NULL; e = e->next) {
-	    bool compiled = (e->ext != NULL);
+	    bool not_compiled = (e->ext == NULL);
 
 	    /* e->ext_regex has already been checked for validity
 	     * elsewhere.  Compile its specified regex if we haven't
 	     * already. */
-	    if (!compiled) {
+	    if (not_compiled) {
 		e->ext = (regex_t *)nmalloc(sizeof(regex_t));
 		regcomp(e->ext, e->ext_regex, REG_EXTENDED);
 	    }
@@ -137,9 +137,10 @@ void color_update(void)
 
 	    /* Decompile e->ext_regex's specified regex if we aren't
 	     * going to use it. */
-	    if (!compiled) {
+	    if (not_compiled) {
 		regfree(e->ext);
 		free(e->ext);
+		e->ext = NULL;
 	    }
 	}
     }
-- 
GitLab