If the prompt variable was set to a value that is not a string, memory that has been freed would be used when displaying the command prompt. This could lead to strange prompts and possible access violations, although it may appear to work OK if the freed memory has not been modified. This patch fixes that issue. It also eliminates some useless allocations of strings when defining variables.
This issue has been fixed in branch beta_jdm in commit 0dfba3b826fbfcf378b4dc72cdc7265093caecaf.