diff options
| author | Matt Kraai <kraai@debian.org> | 2001-01-05 02:53:11 +0000 |
|---|---|---|
| committer | Matt Kraai <kraai@debian.org> | 2001-01-05 02:53:11 +0000 |
| commit | defcd5e75eec72aa31e9bdbd9ac854832318f82f (patch) | |
| tree | ef1e9912dd104fc6b2b8238431aad6a065d56c9c /shell | |
| parent | 6c6ea6cba2aee7b116dc3d5a64f511fb97468cd1 (diff) | |
| download | busybox-w32-defcd5e75eec72aa31e9bdbd9ac854832318f82f.tar.gz busybox-w32-defcd5e75eec72aa31e9bdbd9ac854832318f82f.tar.bz2 busybox-w32-defcd5e75eec72aa31e9bdbd9ac854832318f82f.zip | |
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.
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/lash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/lash.c b/shell/lash.c index dd1d3aa5c..3d54b439e 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
| @@ -774,9 +774,9 @@ static int get_command(FILE * source, char *command) | |||
| 774 | return 1; | 774 | return 1; |
| 775 | } | 775 | } |
| 776 | 776 | ||
| 777 | prompt_str = setup_prompt_string(shell_context); | ||
| 778 | |||
| 779 | if (source == stdin) { | 777 | if (source == stdin) { |
| 778 | prompt_str = setup_prompt_string(shell_context); | ||
| 779 | |||
| 780 | #ifdef BB_FEATURE_SH_COMMAND_EDITING | 780 | #ifdef BB_FEATURE_SH_COMMAND_EDITING |
| 781 | /* | 781 | /* |
| 782 | ** enable command line editing only while a command line | 782 | ** enable command line editing only while a command line |
