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.
diff --git a/shell/lash.c b/shell/lash.c
index dd1d3aa..3d54b43 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -774,9 +774,9 @@
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