aboutsummaryrefslogtreecommitdiff
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
parentabec344ab7060d940f133d93b76e6bbe5881e205 (diff)
downloadbusybox-w32-004015e9c4e8ff98bcbaf955cf42147218204da4.tar.gz
busybox-w32-004015e9c4e8ff98bcbaf955cf42147218204da4.tar.bz2
busybox-w32-004015e9c4e8ff98bcbaf955cf42147218204da4.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)
-rw-r--r--Config.h21
-rw-r--r--applets/usage.h4
-rw-r--r--cmdedit.c14
-rw-r--r--coreutils/tail.c12
-rw-r--r--hush.c6
-rw-r--r--include/usage.h4
-rw-r--r--lash.c6
-rw-r--r--networking/ping.c8
-rw-r--r--ping.c8
-rw-r--r--shell/cmdedit.c14
-rw-r--r--shell/hush.c6
-rw-r--r--shell/lash.c6
-rw-r--r--tail.c12
-rw-r--r--usage.h4
14 files changed, 62 insertions, 63 deletions
diff --git a/Config.h b/Config.h
index 15209beef..d35f1a4bf 100644
--- a/Config.h
+++ b/Config.h
@@ -192,8 +192,8 @@
192// enable ls -L 192// enable ls -L
193#define BB_FEATURE_LS_FOLLOWLINKS 193#define BB_FEATURE_LS_FOLLOWLINKS
194// 194//
195// Change ping implementation -- simplified, featureless, but really small. 195// Disable for a smaller (but less functional) ping
196//#define BB_FEATURE_SIMPLE_PING 196#define BB_FEATURE_FANCY_PING
197// 197//
198// Make init use a simplified /etc/inittab file (recommended). 198// Make init use a simplified /etc/inittab file (recommended).
199#define BB_FEATURE_USE_INITTAB 199#define BB_FEATURE_USE_INITTAB
@@ -213,9 +213,9 @@
213// enable syslogd -C 213// enable syslogd -C
214//#define BB_FEATURE_IPC_SYSLOG 214//#define BB_FEATURE_IPC_SYSLOG
215// 215//
216//Simple tail implementation (2.34k vs 3k for the full one). 216//Disable for a simple tail implementation (2.34k vs 3k for the full one).
217//Both provide 'tail -f', but this cuts out -c, -q, -s, and -v. 217//Both provide 'tail -f', but this cuts out -c, -q, -s, and -v.
218#define BB_FEATURE_SIMPLE_TAIL 218#define BB_FEATURE_FANCY_TAIL
219// 219//
220// Enable support for loop devices in mount 220// Enable support for loop devices in mount
221#define BB_FEATURE_MOUNT_LOOP 221#define BB_FEATURE_MOUNT_LOOP
@@ -273,12 +273,11 @@
273// Only relevant if BB_SH is enabled. Off by default. 273// Only relevant if BB_SH is enabled. Off by default.
274//#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN 274//#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN
275// 275//
276// Some deeply embedded systems don't have usernames or even hostnames, 276// Uncomment this option for a fancy shell prompt that includes the
277// and the default prompt can look rather hideous on them. Uncomment 277// current username and hostname. On systems that don't have usernames
278// this option for a simpler, path-only prompt (which was the default until 278// or hostnames, this can look hideous.
279// around BusyBox-0.48). On by default.
280// Only relevant if BB_SH is enabled. 279// Only relevant if BB_SH is enabled.
281#define BB_FEATURE_SH_SIMPLE_PROMPT 280//#define BB_FEATURE_SH_FANCY_PROMPT
282// 281//
283//Turn on extra fbset options 282//Turn on extra fbset options
284//#define BB_FEATURE_FBSET_FANCY 283//#define BB_FEATURE_FBSET_FANCY
@@ -389,12 +388,12 @@
389 #undef BB_FEATURE_COMMAND_EDITING 388 #undef BB_FEATURE_COMMAND_EDITING
390 #undef BB_FEATURE_COMMAND_TAB_COMPLETION 389 #undef BB_FEATURE_COMMAND_TAB_COMPLETION
391 #undef BB_FEATURE_COMMAND_USERNAME_COMPLETION 390 #undef BB_FEATURE_COMMAND_USERNAME_COMPLETION
392 #define BB_FEATURE_SH_SIMPLE_PROMPT 391 #undef BB_FEATURE_SH_FANCY_PROMPT
393 #endif 392 #endif
394#else 393#else
395 #undef BB_FEATURE_SH_APPLETS_ALWAYS_WIN 394 #undef BB_FEATURE_SH_APPLETS_ALWAYS_WIN
396 #undef BB_FEATURE_SH_STANDALONE_SHELL 395 #undef BB_FEATURE_SH_STANDALONE_SHELL
397 #undef BB_FEATURE_SH_SIMPLE_PROMPT 396 #undef BB_FEATURE_SH_FANCY_PROMPT
398#endif 397#endif
399// 398//
400#ifdef BB_KILLALL 399#ifdef BB_KILLALL
diff --git a/applets/usage.h b/applets/usage.h
index b442e8b35..63c00c674 100644
--- a/applets/usage.h
+++ b/applets/usage.h
@@ -1166,7 +1166,7 @@
1166 "Name: debian\n" \ 1166 "Name: debian\n" \
1167 "Address: 127.0.0.1\n" 1167 "Address: 127.0.0.1\n"
1168 1168
1169#ifdef BB_FEATURE_SIMPLE_PING 1169#ifndef BB_FEATURE_FANCY_PING
1170#define ping_trivial_usage "host" 1170#define ping_trivial_usage "host"
1171#define ping_full_usage "Send ICMP ECHO_REQUEST packets to network hosts" 1171#define ping_full_usage "Send ICMP ECHO_REQUEST packets to network hosts"
1172#else 1172#else
@@ -1433,7 +1433,7 @@
1433 "$ syslogd -R 192.168.1.1:601\n" 1433 "$ syslogd -R 192.168.1.1:601\n"
1434 1434
1435 1435
1436#ifdef BB_FEATURE_SIMPLE_TAIL 1436#ifndef BB_FEATURE_FANCY_TAIL
1437 #define USAGE_UNSIMPLE_TAIL(a) 1437 #define USAGE_UNSIMPLE_TAIL(a)
1438#else 1438#else
1439 #define USAGE_UNSIMPLE_TAIL(a) a 1439 #define USAGE_UNSIMPLE_TAIL(a) a
diff --git a/cmdedit.c b/cmdedit.c
index cc39e562a..a87723139 100644
--- a/cmdedit.c
+++ b/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 */
151static int len; /* --- "" - - "" - -"- --""-- --""--- */ 151static int len; /* --- "" - - "" - -"- --""-- --""--- */
152static char *command_ps; /* --- "" - - "" - -"- --""-- --""--- */ 152static char *command_ps; /* --- "" - - "" - -"- --""-- --""--- */
153static 153static
154#ifdef BB_FEATURE_SH_SIMPLE_PROMPT 154#ifndef BB_FEATURE_SH_FANCY_PROMPT
155 const 155 const
156#endif 156#endif
157char *cmdedit_prompt; /* --- "" - - "" - -"- --""-- --""--- */ 157char *cmdedit_prompt; /* --- "" - - "" - -"- --""-- --""--- */
@@ -166,7 +166,7 @@ static char *home_pwd_buf = "";
166static int my_euid; 166static int my_euid;
167#endif 167#endif
168 168
169#ifndef BB_FEATURE_SH_SIMPLE_PROMPT 169#ifdef BB_FEATURE_SH_FANCY_PROMPT
170static char *hostname_buf = ""; 170static char *hostname_buf = "";
171static int num_ok_lines = 1; 171static 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
339static void parse_prompt(const char *prmt_ptr) 339static 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/coreutils/tail.c b/coreutils/tail.c
index ff77bde77..4fe92ba5e 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -73,7 +73,7 @@ int tail_main(int argc, char **argv)
73 case 'f': 73 case 'f':
74 follow = 1; 74 follow = 1;
75 break; 75 break;
76#ifndef BB_FEATURE_SIMPLE_TAIL 76#ifdef BB_FEATURE_FANCY_TAIL
77 case 'c': 77 case 'c':
78 units = BYTES; 78 units = BYTES;
79 /* FALLS THROUGH */ 79 /* FALLS THROUGH */
@@ -85,7 +85,7 @@ int tail_main(int argc, char **argv)
85 if (optarg[0] == '+') 85 if (optarg[0] == '+')
86 from_top = 1; 86 from_top = 1;
87 break; 87 break;
88#ifndef BB_FEATURE_SIMPLE_TAIL 88#ifdef BB_FEATURE_FANCY_TAIL
89 case 'q': 89 case 'q':
90 hide_headers = 1; 90 hide_headers = 1;
91 break; 91 break;
@@ -118,7 +118,7 @@ int tail_main(int argc, char **argv)
118 } 118 }
119 } 119 }
120 120
121#ifndef BB_FEATURE_SIMPLE_TAIL 121#ifdef BB_FEATURE_FANCY_TAIL
122 /* tail the files */ 122 /* tail the files */
123 if (!from_top && units == BYTES) 123 if (!from_top && units == BYTES)
124 tailbuf = xmalloc(count); 124 tailbuf = xmalloc(count);
@@ -132,7 +132,7 @@ int tail_main(int argc, char **argv)
132 printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]); 132 printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]);
133 while ((nread = safe_read(fds[i], buf, sizeof(buf))) > 0) { 133 while ((nread = safe_read(fds[i], buf, sizeof(buf))) > 0) {
134 if (from_top) { 134 if (from_top) {
135#ifndef BB_FEATURE_SIMPLE_TAIL 135#ifdef BB_FEATURE_FANCY_TAIL
136 if (units == BYTES) { 136 if (units == BYTES) {
137 if (count - 1 <= seen) 137 if (count - 1 <= seen)
138 nwrite = nread; 138 nwrite = nread;
@@ -165,7 +165,7 @@ int tail_main(int argc, char **argv)
165 break; 165 break;
166 } 166 }
167 } else { 167 } else {
168#ifndef BB_FEATURE_SIMPLE_TAIL 168#ifdef BB_FEATURE_FANCY_TAIL
169 if (units == BYTES) { 169 if (units == BYTES) {
170 if (nread < count) { 170 if (nread < count) {
171 memmove(tailbuf, tailbuf + nread, count - nread); 171 memmove(tailbuf, tailbuf + nread, count - nread);
@@ -199,7 +199,7 @@ int tail_main(int argc, char **argv)
199 status = EXIT_FAILURE; 199 status = EXIT_FAILURE;
200 } 200 }
201 201
202#ifndef BB_FEATURE_SIMPLE_TAIL 202#ifdef BB_FEATURE_FANCY_TAIL
203 if (!from_top && units == BYTES) { 203 if (!from_top && units == BYTES) {
204 if (count < seen) 204 if (count < seen)
205 seen = count; 205 seen = count;
diff --git a/hush.c b/hush.c
index fc45bb270..722dcf7ac 100644
--- a/hush.c
+++ b/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
119typedef enum { 119typedef enum {
@@ -843,7 +843,7 @@ static int static_peek(struct in_str *i)
843 843
844static inline void cmdedit_set_initial_prompt(void) 844static 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)
855static inline void setup_prompt_string(int promptmode, char **prompt_str) 855static 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/include/usage.h b/include/usage.h
index b442e8b35..63c00c674 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1166,7 +1166,7 @@
1166 "Name: debian\n" \ 1166 "Name: debian\n" \
1167 "Address: 127.0.0.1\n" 1167 "Address: 127.0.0.1\n"
1168 1168
1169#ifdef BB_FEATURE_SIMPLE_PING 1169#ifndef BB_FEATURE_FANCY_PING
1170#define ping_trivial_usage "host" 1170#define ping_trivial_usage "host"
1171#define ping_full_usage "Send ICMP ECHO_REQUEST packets to network hosts" 1171#define ping_full_usage "Send ICMP ECHO_REQUEST packets to network hosts"
1172#else 1172#else
@@ -1433,7 +1433,7 @@
1433 "$ syslogd -R 192.168.1.1:601\n" 1433 "$ syslogd -R 192.168.1.1:601\n"
1434 1434
1435 1435
1436#ifdef BB_FEATURE_SIMPLE_TAIL 1436#ifndef BB_FEATURE_FANCY_TAIL
1437 #define USAGE_UNSIMPLE_TAIL(a) 1437 #define USAGE_UNSIMPLE_TAIL(a)
1438#else 1438#else
1439 #define USAGE_UNSIMPLE_TAIL(a) a 1439 #define USAGE_UNSIMPLE_TAIL(a) a
diff --git a/lash.c b/lash.c
index cb17e2d75..f1200ba95 100644
--- a/lash.c
+++ b/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
810static inline void cmdedit_set_initial_prompt(void) 810static 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
821static inline void setup_prompt_string(char **prompt_str) 821static 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)
diff --git a/networking/ping.c b/networking/ping.c
index 1afcb28b1..e4307d2de 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.42 2001/05/16 15:52:23 kraai Exp $ 3 * $Id: ping.c,v 1.43 2001/05/21 20:30:51 andersen Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -174,7 +174,7 @@ static int in_cksum(unsigned short *buf, int sz)
174} 174}
175 175
176/* simple version */ 176/* simple version */
177#ifdef BB_FEATURE_SIMPLE_PING 177#ifndef BB_FEATURE_FANCY_PING
178static char *hostname = NULL; 178static char *hostname = NULL;
179 179
180static void noresp(int ign) 180static void noresp(int ign)
@@ -251,7 +251,7 @@ extern int ping_main(int argc, char **argv)
251 return EXIT_SUCCESS; 251 return EXIT_SUCCESS;
252} 252}
253 253
254#else /* ! BB_FEATURE_SIMPLE_PING */ 254#else /* ! BB_FEATURE_FANCY_PING */
255/* full(er) version */ 255/* full(er) version */
256static char *hostname = NULL; 256static char *hostname = NULL;
257static struct sockaddr_in pingaddr; 257static struct sockaddr_in pingaddr;
@@ -534,7 +534,7 @@ extern int ping_main(int argc, char **argv)
534 ping(*argv); 534 ping(*argv);
535 return EXIT_SUCCESS; 535 return EXIT_SUCCESS;
536} 536}
537#endif /* ! BB_FEATURE_SIMPLE_PING */ 537#endif /* ! BB_FEATURE_FANCY_PING */
538 538
539/* 539/*
540 * Copyright (c) 1989 The Regents of the University of California. 540 * Copyright (c) 1989 The Regents of the University of California.
diff --git a/ping.c b/ping.c
index 1afcb28b1..e4307d2de 100644
--- a/ping.c
+++ b/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.42 2001/05/16 15:52:23 kraai Exp $ 3 * $Id: ping.c,v 1.43 2001/05/21 20:30:51 andersen Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -174,7 +174,7 @@ static int in_cksum(unsigned short *buf, int sz)
174} 174}
175 175
176/* simple version */ 176/* simple version */
177#ifdef BB_FEATURE_SIMPLE_PING 177#ifndef BB_FEATURE_FANCY_PING
178static char *hostname = NULL; 178static char *hostname = NULL;
179 179
180static void noresp(int ign) 180static void noresp(int ign)
@@ -251,7 +251,7 @@ extern int ping_main(int argc, char **argv)
251 return EXIT_SUCCESS; 251 return EXIT_SUCCESS;
252} 252}
253 253
254#else /* ! BB_FEATURE_SIMPLE_PING */ 254#else /* ! BB_FEATURE_FANCY_PING */
255/* full(er) version */ 255/* full(er) version */
256static char *hostname = NULL; 256static char *hostname = NULL;
257static struct sockaddr_in pingaddr; 257static struct sockaddr_in pingaddr;
@@ -534,7 +534,7 @@ extern int ping_main(int argc, char **argv)
534 ping(*argv); 534 ping(*argv);
535 return EXIT_SUCCESS; 535 return EXIT_SUCCESS;
536} 536}
537#endif /* ! BB_FEATURE_SIMPLE_PING */ 537#endif /* ! BB_FEATURE_FANCY_PING */
538 538
539/* 539/*
540 * Copyright (c) 1989 The Regents of the University of California. 540 * Copyright (c) 1989 The Regents of the University of California.
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 */
151static int len; /* --- "" - - "" - -"- --""-- --""--- */ 151static int len; /* --- "" - - "" - -"- --""-- --""--- */
152static char *command_ps; /* --- "" - - "" - -"- --""-- --""--- */ 152static char *command_ps; /* --- "" - - "" - -"- --""-- --""--- */
153static 153static
154#ifdef BB_FEATURE_SH_SIMPLE_PROMPT 154#ifndef BB_FEATURE_SH_FANCY_PROMPT
155 const 155 const
156#endif 156#endif
157char *cmdedit_prompt; /* --- "" - - "" - -"- --""-- --""--- */ 157char *cmdedit_prompt; /* --- "" - - "" - -"- --""-- --""--- */
@@ -166,7 +166,7 @@ static char *home_pwd_buf = "";
166static int my_euid; 166static int my_euid;
167#endif 167#endif
168 168
169#ifndef BB_FEATURE_SH_SIMPLE_PROMPT 169#ifdef BB_FEATURE_SH_FANCY_PROMPT
170static char *hostname_buf = ""; 170static char *hostname_buf = "";
171static int num_ok_lines = 1; 171static 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
339static void parse_prompt(const char *prmt_ptr) 339static 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
119typedef enum { 119typedef enum {
@@ -843,7 +843,7 @@ static int static_peek(struct in_str *i)
843 843
844static inline void cmdedit_set_initial_prompt(void) 844static 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)
855static inline void setup_prompt_string(int promptmode, char **prompt_str) 855static 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
810static inline void cmdedit_set_initial_prompt(void) 810static 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
821static inline void setup_prompt_string(char **prompt_str) 821static 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)
diff --git a/tail.c b/tail.c
index ff77bde77..4fe92ba5e 100644
--- a/tail.c
+++ b/tail.c
@@ -73,7 +73,7 @@ int tail_main(int argc, char **argv)
73 case 'f': 73 case 'f':
74 follow = 1; 74 follow = 1;
75 break; 75 break;
76#ifndef BB_FEATURE_SIMPLE_TAIL 76#ifdef BB_FEATURE_FANCY_TAIL
77 case 'c': 77 case 'c':
78 units = BYTES; 78 units = BYTES;
79 /* FALLS THROUGH */ 79 /* FALLS THROUGH */
@@ -85,7 +85,7 @@ int tail_main(int argc, char **argv)
85 if (optarg[0] == '+') 85 if (optarg[0] == '+')
86 from_top = 1; 86 from_top = 1;
87 break; 87 break;
88#ifndef BB_FEATURE_SIMPLE_TAIL 88#ifdef BB_FEATURE_FANCY_TAIL
89 case 'q': 89 case 'q':
90 hide_headers = 1; 90 hide_headers = 1;
91 break; 91 break;
@@ -118,7 +118,7 @@ int tail_main(int argc, char **argv)
118 } 118 }
119 } 119 }
120 120
121#ifndef BB_FEATURE_SIMPLE_TAIL 121#ifdef BB_FEATURE_FANCY_TAIL
122 /* tail the files */ 122 /* tail the files */
123 if (!from_top && units == BYTES) 123 if (!from_top && units == BYTES)
124 tailbuf = xmalloc(count); 124 tailbuf = xmalloc(count);
@@ -132,7 +132,7 @@ int tail_main(int argc, char **argv)
132 printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]); 132 printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]);
133 while ((nread = safe_read(fds[i], buf, sizeof(buf))) > 0) { 133 while ((nread = safe_read(fds[i], buf, sizeof(buf))) > 0) {
134 if (from_top) { 134 if (from_top) {
135#ifndef BB_FEATURE_SIMPLE_TAIL 135#ifdef BB_FEATURE_FANCY_TAIL
136 if (units == BYTES) { 136 if (units == BYTES) {
137 if (count - 1 <= seen) 137 if (count - 1 <= seen)
138 nwrite = nread; 138 nwrite = nread;
@@ -165,7 +165,7 @@ int tail_main(int argc, char **argv)
165 break; 165 break;
166 } 166 }
167 } else { 167 } else {
168#ifndef BB_FEATURE_SIMPLE_TAIL 168#ifdef BB_FEATURE_FANCY_TAIL
169 if (units == BYTES) { 169 if (units == BYTES) {
170 if (nread < count) { 170 if (nread < count) {
171 memmove(tailbuf, tailbuf + nread, count - nread); 171 memmove(tailbuf, tailbuf + nread, count - nread);
@@ -199,7 +199,7 @@ int tail_main(int argc, char **argv)
199 status = EXIT_FAILURE; 199 status = EXIT_FAILURE;
200 } 200 }
201 201
202#ifndef BB_FEATURE_SIMPLE_TAIL 202#ifdef BB_FEATURE_FANCY_TAIL
203 if (!from_top && units == BYTES) { 203 if (!from_top && units == BYTES) {
204 if (count < seen) 204 if (count < seen)
205 seen = count; 205 seen = count;
diff --git a/usage.h b/usage.h
index b442e8b35..63c00c674 100644
--- a/usage.h
+++ b/usage.h
@@ -1166,7 +1166,7 @@
1166 "Name: debian\n" \ 1166 "Name: debian\n" \
1167 "Address: 127.0.0.1\n" 1167 "Address: 127.0.0.1\n"
1168 1168
1169#ifdef BB_FEATURE_SIMPLE_PING 1169#ifndef BB_FEATURE_FANCY_PING
1170#define ping_trivial_usage "host" 1170#define ping_trivial_usage "host"
1171#define ping_full_usage "Send ICMP ECHO_REQUEST packets to network hosts" 1171#define ping_full_usage "Send ICMP ECHO_REQUEST packets to network hosts"
1172#else 1172#else
@@ -1433,7 +1433,7 @@
1433 "$ syslogd -R 192.168.1.1:601\n" 1433 "$ syslogd -R 192.168.1.1:601\n"
1434 1434
1435 1435
1436#ifdef BB_FEATURE_SIMPLE_TAIL 1436#ifndef BB_FEATURE_FANCY_TAIL
1437 #define USAGE_UNSIMPLE_TAIL(a) 1437 #define USAGE_UNSIMPLE_TAIL(a)
1438#else 1438#else
1439 #define USAGE_UNSIMPLE_TAIL(a) a 1439 #define USAGE_UNSIMPLE_TAIL(a) a