aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-21 20:30:51 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-21 20:30:51 +0000
commit004015e9c4e8ff98bcbaf955cf42147218204da4 (patch)
treeb6f1eb9281b70d0723d82a68ed090e619dbbf606 /shell
parentabec344ab7060d940f133d93b76e6bbe5881e205 (diff)
downloadbusybox-004015e9c4e8ff98bcbaf955cf42147218204da4.tar.gz
Patch from Lars Kellogg-Stedman <lars@larsshack.org> to fix bug
#1130 (i.e. When you turn on features it should always ADD features)
Diffstat (limited to 'shell')
-rw-r--r--shell/cmdedit.c14
-rw-r--r--shell/hush.c6
-rw-r--r--shell/lash.c6
3 files changed, 13 insertions, 13 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index cc39e562a..a87723139 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -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\\]";
diff --git a/shell/hush.c b/shell/hush.c
index fc45bb270..722dcf7ac 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -113,7 +113,7 @@
#define applet_name "hush"
#include "standalone.h"
#define shell_main main
-#define BB_FEATURE_SH_SIMPLE_PROMPT
+#undef BB_FEATURE_SH_FANCY_PROMPT
#endif
typedef enum {
@@ -843,7 +843,7 @@ static int static_peek(struct in_str *i)
static inline void cmdedit_set_initial_prompt(void)
{
-#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_FANCY_PROMPT
PS1 = NULL;
#else
PS1 = getenv("PS1");
@@ -855,7 +855,7 @@ static inline void cmdedit_set_initial_prompt(void)
static inline void setup_prompt_string(int promptmode, char **prompt_str)
{
debug_printf("setup_prompt_string %d ",promptmode);
-#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_FANCY_PROMPT
/* Set up the prompt */
if (promptmode == 1) {
if (PS1)
diff --git a/shell/lash.c b/shell/lash.c
index cb17e2d75..f1200ba95 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -436,7 +436,7 @@ static int builtin_export(struct child_prog *child)
res = putenv(v);
if (res)
fprintf(stderr, "export: %m\n");
-#ifndef BB_FEATURE_SH_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_FANCY_PROMPT
if (strncmp(v, "PS1=", 4)==0)
PS1 = getenv("PS1");
#endif
@@ -809,7 +809,7 @@ static void restore_redirects(int squirrel[])
static inline void cmdedit_set_initial_prompt(void)
{
-#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_FANCY_PROMPT
PS1 = NULL;
#else
PS1 = getenv("PS1");
@@ -820,7 +820,7 @@ static inline void cmdedit_set_initial_prompt(void)
static inline void setup_prompt_string(char **prompt_str)
{
-#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_FANCY_PROMPT
/* Set up the prompt */
if (shell_context == 0) {
if (PS1)