commit | defcd5e75eec72aa31e9bdbd9ac854832318f82f | [log] [tgz] |
---|---|---|
author | Matt Kraai <kraai@debian.org> | Fri Jan 05 02:53:11 2001 +0000 |
committer | Matt Kraai <kraai@debian.org> | Fri Jan 05 02:53:11 2001 +0000 |
tree | ef1e9912dd104fc6b2b8238431aad6a065d56c9c | |
parent | 6c6ea6cba2aee7b116dc3d5a64f511fb97468cd1 [diff] [blame] |
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/sh.c b/sh.c index dd1d3aa..3d54b43 100644 --- a/sh.c +++ b/sh.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