diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-01-05 02:53:11 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-01-05 02:53:11 +0000 |
commit | 10b3492ba4625dd67872181760c6f3cff5912c50 (patch) | |
tree | ef1e9912dd104fc6b2b8238431aad6a065d56c9c /sh.c | |
parent | b20024cf0acb79623b33fd53e2afb85b35ce479a (diff) | |
download | busybox-w32-10b3492ba4625dd67872181760c6f3cff5912c50.tar.gz busybox-w32-10b3492ba4625dd67872181760c6f3cff5912c50.tar.bz2 busybox-w32-10b3492ba4625dd67872181760c6f3cff5912c50.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.
git-svn-id: svn://busybox.net/trunk/busybox@1538 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sh.c')
-rw-r--r-- | sh.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |