Browse Source

Create its own context for renew_prompt(). Fix issue #87

git-svn-id: https://klish.googlecode.com/svn/trunk@529 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 12 years ago
parent
commit
3c69dec9d2
1 changed files with 6 additions and 1 deletions
  1. 6 1
      clish/shell/shell_tinyrl.c

+ 6 - 1
clish/shell/shell_tinyrl.c

@@ -22,13 +22,18 @@
 static void clish_shell_renew_prompt(tinyrl_t *this)
 {
 	clish_context_t *context = tinyrl__get_context(this);
+	clish_context_t prompt_context;
 	char *prompt = NULL;
 	const clish_view_t *view;
 
+	/* Create appropriate context */
+	memset(&prompt_context, 0, sizeof(prompt_context));
+	prompt_context.shell = context->shell;
+
 	/* Obtain the prompt */
 	view = clish_shell__get_view(context->shell);
 	assert(view);
-	prompt = clish_shell_expand(clish_view__get_prompt(view), SHELL_VAR_ACTION, context);
+	prompt = clish_shell_expand(clish_view__get_prompt(view), SHELL_VAR_ACTION, &prompt_context);
 	assert(prompt);
 	tinyrl__set_prompt(this, prompt);
 	lub_string_free(prompt);