diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-21 20:30:51 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-21 20:30:51 +0000 |
commit | 9cf9dad93666777f825ef46617056871534bec1f (patch) | |
tree | b6f1eb9281b70d0723d82a68ed090e619dbbf606 /shell | |
parent | 63a2ff929f13762d6d843471d1364c99959c7466 (diff) | |
download | busybox-w32-9cf9dad93666777f825ef46617056871534bec1f.tar.gz busybox-w32-9cf9dad93666777f825ef46617056871534bec1f.tar.bz2 busybox-w32-9cf9dad93666777f825ef46617056871534bec1f.zip |
Patch from Lars Kellogg-Stedman <lars@larsshack.org> to fix bug
#1130 (i.e. When you turn on features it should always ADD features)
git-svn-id: svn://busybox.net/trunk/busybox@2690 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cmdedit.c | 14 | ||||
-rw-r--r-- | shell/hush.c | 6 | ||||
-rw-r--r-- | shell/lash.c | 6 |
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 @@ | |||
76 | #undef BB_FEATURE_COMMAND_USERNAME_COMPLETION | 76 | #undef BB_FEATURE_COMMAND_USERNAME_COMPLETION |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #if defined(BB_FEATURE_COMMAND_USERNAME_COMPLETION) || !defined(BB_FEATURE_SH_SIMPLE_PROMPT) | 79 | #if defined(BB_FEATURE_COMMAND_USERNAME_COMPLETION) || defined(BB_FEATURE_SH_FANCY_PROMPT) |
80 | #define BB_FEATURE_GETUSERNAME_AND_HOMEDIR | 80 | #define BB_FEATURE_GETUSERNAME_AND_HOMEDIR |
81 | #endif | 81 | #endif |
82 | 82 | ||
@@ -151,7 +151,7 @@ static int cursor; /* required global for signal handler */ | |||
151 | static int len; /* --- "" - - "" - -"- --""-- --""--- */ | 151 | static int len; /* --- "" - - "" - -"- --""-- --""--- */ |
152 | static char *command_ps; /* --- "" - - "" - -"- --""-- --""--- */ | 152 | static char *command_ps; /* --- "" - - "" - -"- --""-- --""--- */ |
153 | static | 153 | static |
154 | #ifdef BB_FEATURE_SH_SIMPLE_PROMPT | 154 | #ifndef BB_FEATURE_SH_FANCY_PROMPT |
155 | const | 155 | const |
156 | #endif | 156 | #endif |
157 | char *cmdedit_prompt; /* --- "" - - "" - -"- --""-- --""--- */ | 157 | char *cmdedit_prompt; /* --- "" - - "" - -"- --""-- --""--- */ |
@@ -166,7 +166,7 @@ static char *home_pwd_buf = ""; | |||
166 | static int my_euid; | 166 | static int my_euid; |
167 | #endif | 167 | #endif |
168 | 168 | ||
169 | #ifndef BB_FEATURE_SH_SIMPLE_PROMPT | 169 | #ifdef BB_FEATURE_SH_FANCY_PROMPT |
170 | static char *hostname_buf = ""; | 170 | static char *hostname_buf = ""; |
171 | static int num_ok_lines = 1; | 171 | static int num_ok_lines = 1; |
172 | #endif | 172 | #endif |
@@ -335,7 +335,7 @@ static void put_prompt(void) | |||
335 | cursor = 0; | 335 | cursor = 0; |
336 | } | 336 | } |
337 | 337 | ||
338 | #ifdef BB_FEATURE_SH_SIMPLE_PROMPT | 338 | #ifndef BB_FEATURE_SH_FANCY_PROMPT |
339 | static void parse_prompt(const char *prmt_ptr) | 339 | static void parse_prompt(const char *prmt_ptr) |
340 | { | 340 | { |
341 | cmdedit_prompt = prmt_ptr; | 341 | cmdedit_prompt = prmt_ptr; |
@@ -1469,7 +1469,7 @@ prepare_to_die: | |||
1469 | history_counter++; | 1469 | history_counter++; |
1470 | } | 1470 | } |
1471 | } | 1471 | } |
1472 | #if !defined(BB_FEATURE_SH_SIMPLE_PROMPT) | 1472 | #if defined(BB_FEATURE_SH_FANCY_PROMPT) |
1473 | num_ok_lines++; | 1473 | num_ok_lines++; |
1474 | #endif | 1474 | #endif |
1475 | } | 1475 | } |
@@ -1478,7 +1478,7 @@ prepare_to_die: | |||
1478 | #if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION) | 1478 | #if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION) |
1479 | input_tab(0); /* strong free */ | 1479 | input_tab(0); /* strong free */ |
1480 | #endif | 1480 | #endif |
1481 | #if !defined(BB_FEATURE_SH_SIMPLE_PROMPT) | 1481 | #if defined(BB_FEATURE_SH_FANCY_PROMPT) |
1482 | free(cmdedit_prompt); | 1482 | free(cmdedit_prompt); |
1483 | #endif | 1483 | #endif |
1484 | return; | 1484 | return; |
@@ -1519,7 +1519,7 @@ int main(int argc, char **argv) | |||
1519 | { | 1519 | { |
1520 | char buff[BUFSIZ]; | 1520 | char buff[BUFSIZ]; |
1521 | char *prompt = | 1521 | char *prompt = |
1522 | #if !defined(BB_FEATURE_SH_SIMPLE_PROMPT) | 1522 | #if defined(BB_FEATURE_SH_FANCY_PROMPT) |
1523 | "\\[\\033[32;1m\\]\\u@\\[\\x1b[33;1m\\]\\h:\ | 1523 | "\\[\\033[32;1m\\]\\u@\\[\\x1b[33;1m\\]\\h:\ |
1524 | \\[\\033[34;1m\\]\\w\\[\\033[35;1m\\] \ | 1524 | \\[\\033[34;1m\\]\\w\\[\\033[35;1m\\] \ |
1525 | \\!\\[\\e[36;1m\\]\\$ \\[\\E[0m\\]"; | 1525 | \\!\\[\\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 @@ | |||
113 | #define applet_name "hush" | 113 | #define applet_name "hush" |
114 | #include "standalone.h" | 114 | #include "standalone.h" |
115 | #define shell_main main | 115 | #define shell_main main |
116 | #define BB_FEATURE_SH_SIMPLE_PROMPT | 116 | #undef BB_FEATURE_SH_FANCY_PROMPT |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | typedef enum { | 119 | typedef enum { |
@@ -843,7 +843,7 @@ static int static_peek(struct in_str *i) | |||
843 | 843 | ||
844 | static inline void cmdedit_set_initial_prompt(void) | 844 | static inline void cmdedit_set_initial_prompt(void) |
845 | { | 845 | { |
846 | #ifdef BB_FEATURE_SH_SIMPLE_PROMPT | 846 | #ifndef BB_FEATURE_SH_FANCY_PROMPT |
847 | PS1 = NULL; | 847 | PS1 = NULL; |
848 | #else | 848 | #else |
849 | PS1 = getenv("PS1"); | 849 | PS1 = getenv("PS1"); |
@@ -855,7 +855,7 @@ static inline void cmdedit_set_initial_prompt(void) | |||
855 | static inline void setup_prompt_string(int promptmode, char **prompt_str) | 855 | static inline void setup_prompt_string(int promptmode, char **prompt_str) |
856 | { | 856 | { |
857 | debug_printf("setup_prompt_string %d ",promptmode); | 857 | debug_printf("setup_prompt_string %d ",promptmode); |
858 | #ifdef BB_FEATURE_SH_SIMPLE_PROMPT | 858 | #ifndef BB_FEATURE_SH_FANCY_PROMPT |
859 | /* Set up the prompt */ | 859 | /* Set up the prompt */ |
860 | if (promptmode == 1) { | 860 | if (promptmode == 1) { |
861 | if (PS1) | 861 | 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) | |||
436 | res = putenv(v); | 436 | res = putenv(v); |
437 | if (res) | 437 | if (res) |
438 | fprintf(stderr, "export: %m\n"); | 438 | fprintf(stderr, "export: %m\n"); |
439 | #ifndef BB_FEATURE_SH_SIMPLE_PROMPT | 439 | #ifdef BB_FEATURE_SH_FANCY_PROMPT |
440 | if (strncmp(v, "PS1=", 4)==0) | 440 | if (strncmp(v, "PS1=", 4)==0) |
441 | PS1 = getenv("PS1"); | 441 | PS1 = getenv("PS1"); |
442 | #endif | 442 | #endif |
@@ -809,7 +809,7 @@ static void restore_redirects(int squirrel[]) | |||
809 | 809 | ||
810 | static inline void cmdedit_set_initial_prompt(void) | 810 | static inline void cmdedit_set_initial_prompt(void) |
811 | { | 811 | { |
812 | #ifdef BB_FEATURE_SH_SIMPLE_PROMPT | 812 | #ifndef BB_FEATURE_SH_FANCY_PROMPT |
813 | PS1 = NULL; | 813 | PS1 = NULL; |
814 | #else | 814 | #else |
815 | PS1 = getenv("PS1"); | 815 | PS1 = getenv("PS1"); |
@@ -820,7 +820,7 @@ static inline void cmdedit_set_initial_prompt(void) | |||
820 | 820 | ||
821 | static inline void setup_prompt_string(char **prompt_str) | 821 | static inline void setup_prompt_string(char **prompt_str) |
822 | { | 822 | { |
823 | #ifdef BB_FEATURE_SH_SIMPLE_PROMPT | 823 | #ifndef BB_FEATURE_SH_FANCY_PROMPT |
824 | /* Set up the prompt */ | 824 | /* Set up the prompt */ |
825 | if (shell_context == 0) { | 825 | if (shell_context == 0) { |
826 | if (PS1) | 826 | if (PS1) |