From 10b3492ba4625dd67872181760c6f3cff5912c50 Mon Sep 17 00:00:00 2001 From: kraai Date: Fri, 5 Jan 2001 02:53:11 +0000 Subject: Fix a segfault by only constructing the prompt when we need to. If we don't do this we will segfault processing /etc/.profile since cwd isn't yet set. git-svn-id: svn://busybox.net/trunk/busybox@1538 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- sh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sh.c') diff --git a/sh.c b/sh.c index dd1d3aa5c..3d54b439e 100644 --- a/sh.c +++ b/sh.c @@ -774,9 +774,9 @@ static int get_command(FILE * source, char *command) return 1; } - prompt_str = setup_prompt_string(shell_context); - if (source == stdin) { + prompt_str = setup_prompt_string(shell_context); + #ifdef BB_FEATURE_SH_COMMAND_EDITING /* ** enable command line editing only while a command line -- cgit v1.2.3-55-g6feb