Patch from Lars Kellogg-Stedman <lars@larsshack.org> to fix bug

#1130 (i.e. When you turn on features it should always ADD features)
This commit is contained in:
Eric Andersen
2001-05-21 20:30:51 +00:00
parent abec344ab7
commit 004015e9c4
14 changed files with 62 additions and 63 deletions

View File

@ -76,7 +76,7 @@
#undef BB_FEATURE_COMMAND_USERNAME_COMPLETION
#endif
#if defined(BB_FEATURE_COMMAND_USERNAME_COMPLETION) || !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
#if defined(BB_FEATURE_COMMAND_USERNAME_COMPLETION) || defined(BB_FEATURE_SH_FANCY_PROMPT)
#define BB_FEATURE_GETUSERNAME_AND_HOMEDIR
#endif
@ -151,7 +151,7 @@ static int cursor; /* required global for signal handler */
static int len; /* --- "" - - "" - -"- --""-- --""--- */
static char *command_ps; /* --- "" - - "" - -"- --""-- --""--- */
static
#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
#ifndef BB_FEATURE_SH_FANCY_PROMPT
const
#endif
char *cmdedit_prompt; /* --- "" - - "" - -"- --""-- --""--- */
@ -166,7 +166,7 @@ static char *home_pwd_buf = "";
static int my_euid;
#endif
#ifndef BB_FEATURE_SH_SIMPLE_PROMPT
#ifdef BB_FEATURE_SH_FANCY_PROMPT
static char *hostname_buf = "";
static int num_ok_lines = 1;
#endif
@ -335,7 +335,7 @@ static void put_prompt(void)
cursor = 0;
}
#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
#ifndef BB_FEATURE_SH_FANCY_PROMPT
static void parse_prompt(const char *prmt_ptr)
{
cmdedit_prompt = prmt_ptr;
@ -1469,7 +1469,7 @@ prepare_to_die:
history_counter++;
}
}
#if !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
#if defined(BB_FEATURE_SH_FANCY_PROMPT)
num_ok_lines++;
#endif
}
@ -1478,7 +1478,7 @@ prepare_to_die:
#if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION)
input_tab(0); /* strong free */
#endif
#if !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
#if defined(BB_FEATURE_SH_FANCY_PROMPT)
free(cmdedit_prompt);
#endif
return;
@ -1519,7 +1519,7 @@ int main(int argc, char **argv)
{
char buff[BUFSIZ];
char *prompt =
#if !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
#if defined(BB_FEATURE_SH_FANCY_PROMPT)
"\\[\\033[32;1m\\]\\u@\\[\\x1b[33;1m\\]\\h:\
\\[\\033[34;1m\\]\\w\\[\\033[35;1m\\] \
\\!\\[\\e[36;1m\\]\\$ \\[\\E[0m\\]";