Quellcode durchsuchen

PTYPE's ACTION. Empty out is non-translation

Serj Kalichev vor 4 Jahren
Ursprung
Commit
152abdb3d6
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5 2
      clish/shell/shell_parse.c

+ 5 - 2
clish/shell/shell_parse.c

@@ -69,8 +69,11 @@ static char *clish_shell_param_validate(const clish_param_t *param, const char *
 		lub_string_free(out);
 		return NULL; // Fail on bad ACTION retval
 	}
-	if (out)
-		return out;
+	if (out) {
+		if (*out != '\0') // Non-empty str is transformation
+			return out;
+		lub_string_free(out);
+	}
 
 	return lub_string_dup(text);
 }