aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/shell/hush.c b/shell/hush.c
index cb0e6e980..d37842b79 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -113,7 +113,8 @@
113#define applet_name "hush" 113#define applet_name "hush"
114#include "standalone.h" 114#include "standalone.h"
115#define hush_main main 115#define hush_main main
116#undef BB_FEATURE_SH_FANCY_PROMPT 116#undef CONFIG_FEATURE_SH_FANCY_PROMPT
117#define BB_BANNER
117#endif 118#endif
118 119
119typedef enum { 120typedef enum {
@@ -836,7 +837,7 @@ static int static_peek(struct in_str *i)
836 837
837static inline void cmdedit_set_initial_prompt(void) 838static inline void cmdedit_set_initial_prompt(void)
838{ 839{
839#ifndef BB_FEATURE_SH_FANCY_PROMPT 840#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
840 PS1 = NULL; 841 PS1 = NULL;
841#else 842#else
842 PS1 = getenv("PS1"); 843 PS1 = getenv("PS1");
@@ -848,7 +849,7 @@ static inline void cmdedit_set_initial_prompt(void)
848static inline void setup_prompt_string(int promptmode, char **prompt_str) 849static inline void setup_prompt_string(int promptmode, char **prompt_str)
849{ 850{
850 debug_printf("setup_prompt_string %d ",promptmode); 851 debug_printf("setup_prompt_string %d ",promptmode);
851#ifndef BB_FEATURE_SH_FANCY_PROMPT 852#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
852 /* Set up the prompt */ 853 /* Set up the prompt */
853 if (promptmode == 1) { 854 if (promptmode == 1) {
854 if (PS1) 855 if (PS1)
@@ -871,7 +872,7 @@ static void get_user_input(struct in_str *i)
871 static char the_command[BUFSIZ]; 872 static char the_command[BUFSIZ];
872 873
873 setup_prompt_string(i->promptmode, &prompt_str); 874 setup_prompt_string(i->promptmode, &prompt_str);
874#ifdef BB_FEATURE_COMMAND_EDITING 875#ifdef CONFIG_FEATURE_COMMAND_EDITING
875 /* 876 /*
876 ** enable command line editing only while a command line 877 ** enable command line editing only while a command line
877 ** is actually being read; otherwise, we'll end up bequeathing 878 ** is actually being read; otherwise, we'll end up bequeathing
@@ -1085,18 +1086,18 @@ static void pseudo_exec(struct child_prog *child)
1085 * really dislike relying on /proc for things. We could exec ourself 1086 * really dislike relying on /proc for things. We could exec ourself
1086 * from global_argv[0], but if we are in a chroot, we may not be able 1087 * from global_argv[0], but if we are in a chroot, we may not be able
1087 * to find ourself... */ 1088 * to find ourself... */
1088#ifdef BB_FEATURE_SH_STANDALONE_SHELL 1089#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
1089 { 1090 {
1090 int argc_l; 1091 int argc_l;
1091 char** argv_l=child->argv; 1092 char** argv_l=child->argv;
1092 char *name = child->argv[0]; 1093 char *name = child->argv[0];
1093 1094
1094#ifdef BB_FEATURE_SH_APPLETS_ALWAYS_WIN 1095#ifdef CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
1095 /* Following discussions from November 2000 on the busybox mailing 1096 /* Following discussions from November 2000 on the busybox mailing
1096 * list, the default configuration, (without 1097 * list, the default configuration, (without
1097 * get_last_path_component()) lets the user force use of an 1098 * get_last_path_component()) lets the user force use of an
1098 * external command by specifying the full (with slashes) filename. 1099 * external command by specifying the full (with slashes) filename.
1099 * If you enable BB_FEATURE_SH_APPLETS_ALWAYS_WIN, then applets 1100 * If you enable CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN, then applets
1100 * _aways_ override external commands, so if you want to run 1101 * _aways_ override external commands, so if you want to run
1101 * /bin/cat, it will use BusyBox cat even if /bin/cat exists on the 1102 * /bin/cat, it will use BusyBox cat even if /bin/cat exists on the
1102 * filesystem and is _not_ busybox. Some systems may want this, 1103 * filesystem and is _not_ busybox. Some systems may want this,
@@ -2586,7 +2587,7 @@ int hush_main(int argc, char **argv)
2586 2587
2587 /* Initialize some more globals to non-zero values */ 2588 /* Initialize some more globals to non-zero values */
2588 set_cwd(); 2589 set_cwd();
2589#ifdef BB_FEATURE_COMMAND_EDITING 2590#ifdef CONFIG_FEATURE_COMMAND_EDITING
2590 cmdedit_set_initial_prompt(); 2591 cmdedit_set_initial_prompt();
2591#else 2592#else
2592 PS1 = NULL; 2593 PS1 = NULL;
@@ -2655,7 +2656,7 @@ int hush_main(int argc, char **argv)
2655 debug_printf("\ninteractive=%d\n", interactive); 2656 debug_printf("\ninteractive=%d\n", interactive);
2656 if (interactive) { 2657 if (interactive) {
2657 /* Looks like they want an interactive shell */ 2658 /* Looks like they want an interactive shell */
2658#ifndef BB_FEATURE_SH_EXTRA_QUIET 2659#ifndef CONFIG_FEATURE_SH_EXTRA_QUIET
2659 printf( "\n\n" BB_BANNER " hush - the humble shell v0.01 (testing)\n"); 2660 printf( "\n\n" BB_BANNER " hush - the humble shell v0.01 (testing)\n");
2660 printf( "Enter 'help' for a list of built-in commands.\n\n"); 2661 printf( "Enter 'help' for a list of built-in commands.\n\n");
2661#endif 2662#endif
@@ -2673,7 +2674,7 @@ int hush_main(int argc, char **argv)
2673 input = xfopen(argv[optind], "r"); 2674 input = xfopen(argv[optind], "r");
2674 opt = parse_file_outer(input); 2675 opt = parse_file_outer(input);
2675 2676
2676#ifdef BB_FEATURE_CLEAN_UP 2677#ifdef CONFIG_FEATURE_CLEAN_UP
2677 fclose(input); 2678 fclose(input);
2678 if (cwd && cwd != unknown) 2679 if (cwd && cwd != unknown)
2679 free((char*)cwd); 2680 free((char*)cwd);