Explorar o código

Fix re-setting of ptype range

Intention here is to update ptypes from scripting plugins.

In my experience this works fine.
Ingo Albrecht %!s(int64=7) %!d(string=hai) anos
pai
achega
429a5aae03
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      clish/ptype/ptype.c

+ 6 - 0
clish/ptype/ptype.c

@@ -154,6 +154,12 @@ static void clish_ptype__set_range(clish_ptype_t * this)
 {
 	char tmp[80];
 
+	/* Clear the range */
+	if (this->range) {
+		lub_string_free(this->range);
+		this->range = NULL;
+	}
+
 	/* Now set up the range values */
 	switch (this->method) {
 	/*------------------------------------------------- */