mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
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.
This commit is contained in:
parent
6c6ea6cba2
commit
defcd5e75e
4
lash.c
4
lash.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
|
||||
|
4
sh.c
4
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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user