svn commit: trunk/busybox: include libbb scripts shell

vda at busybox.net vda at busybox.net
Mon Jan 22 09:03:09 UTC 2007


Author: vda
Date: 2007-01-22 01:03:07 -0800 (Mon, 22 Jan 2007)
New Revision: 17451

Log:
cmdedit is not a 'command' editing anymore, it's just editing (generic),
so rename stuff accordingly.


Modified:
   trunk/busybox/include/libbb.h
   trunk/busybox/libbb/Config.in
   trunk/busybox/libbb/Kbuild
   trunk/busybox/scripts/defconfig
   trunk/busybox/shell/Config.in
   trunk/busybox/shell/Kbuild
   trunk/busybox/shell/ash.c
   trunk/busybox/shell/cmdedit.c
   trunk/busybox/shell/hush.c
   trunk/busybox/shell/lash.c
   trunk/busybox/shell/msh.c


Changeset:
Modified: trunk/busybox/include/libbb.h
===================================================================
--- trunk/busybox/include/libbb.h	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/include/libbb.h	2007-01-22 09:03:07 UTC (rev 17451)
@@ -583,10 +583,10 @@
 #endif
 
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 /* It's NOT just ENABLEd or disabled. It's a number: */
-#ifdef CONFIG_FEATURE_COMMAND_HISTORY
-#define MAX_HISTORY (CONFIG_FEATURE_COMMAND_HISTORY + 0)
+#ifdef CONFIG_FEATURE_EDITING_HISTORY
+#define MAX_HISTORY (CONFIG_FEATURE_EDITING_HISTORY + 0)
 #else
 #define MAX_HISTORY 0
 #endif
@@ -596,16 +596,16 @@
 #if MAX_HISTORY
 	int cnt_history;
 	int cur_history;
-	USE_FEATURE_COMMAND_SAVEHISTORY(const char *hist_file;)
+	USE_FEATURE_EDITING_SAVEHISTORY(const char *hist_file;)
 	char *history[MAX_HISTORY + 1];
 #endif
 };
 enum {
 	DO_HISTORY = 1 * (MAX_HISTORY > 0),
-	SAVE_HISTORY = 2 * (MAX_HISTORY > 0) * ENABLE_FEATURE_COMMAND_SAVEHISTORY,
-	TAB_COMPLETION = 4 * ENABLE_FEATURE_COMMAND_TAB_COMPLETION,
-	USERNAME_COMPLETION = 8 * ENABLE_FEATURE_COMMAND_USERNAME_COMPLETION,
-	VI_MODE = 0x10 * ENABLE_FEATURE_COMMAND_EDITING_VI,
+	SAVE_HISTORY = 2 * (MAX_HISTORY > 0) * ENABLE_FEATURE_EDITING_SAVEHISTORY,
+	TAB_COMPLETION = 4 * ENABLE_FEATURE_TAB_COMPLETION,
+	USERNAME_COMPLETION = 8 * ENABLE_FEATURE_USERNAME_COMPLETION,
+	VI_MODE = 0x10 * ENABLE_FEATURE_EDITING_VI,
 	WITH_PATH_LOOKUP = 0x20,
 	FOR_SHELL = DO_HISTORY | SAVE_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION,
 };

Modified: trunk/busybox/libbb/Config.in
===================================================================
--- trunk/busybox/libbb/Config.in	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/libbb/Config.in	2007-01-22 09:03:07 UTC (rev 17451)
@@ -26,4 +26,63 @@
 	  2                   3.0                5088
 	  3 (smallest)        5.1                4912
 
+config FEATURE_EDITING
+	bool "Command line editing"
+	default n
+	help
+	  Enable command editing (mainly for shell).
+
+config FEATURE_EDITING_FANCY_KEYS
+	bool "Additional editing keys"
+	default n
+	depends on FEATURE_EDITING
+	help
+	  Enable additonal editing keys (Ctrl-E, Ctrl-U etc).
+	  Arrow keys, Home/End/Delete and Ctrl-W work even without this option.
+
+config FEATURE_EDITING_VI
+	bool "vi-style line editing commands"
+	default n
+	depends on FEATURE_EDITING
+	help
+	  Enable vi-style line editing.  In shells, this mode can be
+	  turned on and off with "set -o vi" and "set +o vi".
+
+config FEATURE_EDITING_HISTORY
+	int "History size"
+	range 0 99999
+	default 15
+	depends on FEATURE_EDITING
+	help
+	  Specify command history size.
+
+config FEATURE_EDITING_SAVEHISTORY
+	bool "History saving"
+	default n
+	depends on ASH && FEATURE_EDITING
+	help
+	  Enable history saving in ash shell.
+
+config FEATURE_TAB_COMPLETION
+	bool "Tab completion"
+	default n
+	depends on FEATURE_EDITING
+	help
+	  Enable tab completion.
+
+config FEATURE_USERNAME_COMPLETION
+	bool "Username completion"
+	default n
+	depends on FEATURE_TAB_COMPLETION
+	help
+	  Enable username completion.
+
+config FEATURE_EDITING_FANCY_PROMPT
+	bool "Fancy shell prompts"
+	default n
+	depends on FEATURE_EDITING
+	help
+	  Setting this option allows for prompts to use things like \w and
+	  \$ and escape codes.
+
 endmenu

Modified: trunk/busybox/libbb/Kbuild
===================================================================
--- trunk/busybox/libbb/Kbuild	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/libbb/Kbuild	2007-01-22 09:03:07 UTC (rev 17451)
@@ -46,6 +46,7 @@
 lib-y += isdirectory.o
 lib-y += kernel_version.o
 lib-y += last_char_is.o
+lib-y += lineedit.o
 lib-y += llist.o
 lib-y += login.o
 lib-y += make_directory.o

Modified: trunk/busybox/scripts/defconfig
===================================================================
--- trunk/busybox/scripts/defconfig	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/scripts/defconfig	2007-01-22 09:03:07 UTC (rev 17451)
@@ -631,14 +631,14 @@
 # CONFIG_MSH is not set
 # CONFIG_FEATURE_SH_EXTRA_QUIET is not set
 # CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
-# CONFIG_FEATURE_COMMAND_EDITING is not set
+CONFIG_FEATURE_EDITING=y
 # CONFIG_FEATURE_EDITING_FANCY_KEYS is not set
-# CONFIG_FEATURE_COMMAND_EDITING_VI is not set
-CONFIG_FEATURE_COMMAND_HISTORY=
-# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
-# CONFIG_FEATURE_COMMAND_TAB_COMPLETION is not set
-# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
-# CONFIG_FEATURE_SH_FANCY_PROMPT is not set
+# CONFIG_FEATURE_EDITING_VI is not set
+CONFIG_FEATURE_EDITING_HISTORY=15
+# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set
+# CONFIG_FEATURE_TAB_COMPLETION is not set
+# CONFIG_FEATURE_USERNAME_COMPLETION is not set
+# CONFIG_FEATURE_EDITING_FANCY_PROMPT is not set
 
 #
 # System Logging Utilities

Modified: trunk/busybox/shell/Config.in
===================================================================
--- trunk/busybox/shell/Config.in	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/shell/Config.in	2007-01-22 09:03:07 UTC (rev 17451)
@@ -240,64 +240,4 @@
 	  that exact location with that exact name, this option will not work at
 	  all.
 
-config FEATURE_COMMAND_EDITING
-	bool "Command line editing"
-	default n
-	depends on MSH || LASH || HUSH || ASH
-	help
-	  Enable command editing in shell.
-
-config FEATURE_EDITING_FANCY_KEYS
-	bool "Additional editing keys"
-	default n
-	depends on FEATURE_COMMAND_EDITING
-	help
-	  Enable additonal editing keys (Ctrl-E, Ctrl-U etc).
-	  Arrow keys, Home/End/Delete and Ctrl-W work even without this option.
-
-config FEATURE_COMMAND_EDITING_VI
-	bool "vi-style line editing commands"
-	default n
-	depends on FEATURE_COMMAND_EDITING
-	help
-	  Enable vi-style line editing in the shell.  This mode can be
-	  turned on and off with "set -o vi" and "set +o vi".
-
-config FEATURE_COMMAND_HISTORY
-	int "History size"
-	range 0 99999
-	default 15
-	depends on FEATURE_COMMAND_EDITING
-	help
-	  Specify command history size in shell.
-
-config FEATURE_COMMAND_SAVEHISTORY
-	bool "History saving"
-	default n
-	depends on ASH && FEATURE_COMMAND_EDITING
-	help
-	  Enable history saving in ash shell.
-
-config FEATURE_COMMAND_TAB_COMPLETION
-	bool "Tab completion"
-	default n
-	depends on FEATURE_COMMAND_EDITING
-	help
-	  Enable tab completion in shell.
-
-config FEATURE_COMMAND_USERNAME_COMPLETION
-	bool "Username completion"
-	default n
-	depends on FEATURE_COMMAND_TAB_COMPLETION
-	help
-	  Enable username completion in shell.
-
-config FEATURE_SH_FANCY_PROMPT
-	bool "Fancy shell prompts"
-	default n
-	depends on FEATURE_COMMAND_EDITING
-	help
-	  Setting this option allows for prompts to use things like \w and
-	  \$ and also using escape codes.
-
 endmenu

Modified: trunk/busybox/shell/Kbuild
===================================================================
--- trunk/busybox/shell/Kbuild	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/shell/Kbuild	2007-01-22 09:03:07 UTC (rev 17451)
@@ -5,7 +5,6 @@
 # Licensed under the GPL v2, see the file LICENSE in this tarball.
 
 lib-y:=
-lib-y              += cmdedit.o
 lib-$(CONFIG_ASH)  += ash.o
 lib-$(CONFIG_HUSH) += hush.o
 lib-$(CONFIG_LASH) += lash.o

Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/shell/ash.c	2007-01-22 09:03:07 UTC (rev 17451)
@@ -1528,7 +1528,7 @@
 	{0, VSTRFIXED | VTEXTFIXED | VUNSET, "LC_ALL\0", change_lc_all },
 	{0, VSTRFIXED | VTEXTFIXED | VUNSET, "LC_CTYPE\0", change_lc_ctype },
 #endif
-#if ENABLE_FEATURE_COMMAND_SAVEHISTORY
+#if ENABLE_FEATURE_EDITING_SAVEHISTORY
 	{0, VSTRFIXED | VTEXTFIXED | VUNSET, "HISTFILE\0", NULL },
 #endif
 };
@@ -1654,7 +1654,7 @@
 	/*
 	 * PS1 depends on uid
 	 */
-#if defined(CONFIG_FEATURE_COMMAND_EDITING) && defined(CONFIG_FEATURE_SH_FANCY_PROMPT)
+#if ENABLE_FEATURE_EDITING && ENABLE_FEATURE_EDITING_FANCY_PROMPT
 	vps1.text = "PS1=\\w \\$ ";
 #else
 	if (!geteuid())
@@ -6040,7 +6040,7 @@
 }
 
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 static line_input_t *line_input_state;
 //static SKIP_ASH_EXPAND_PRMT(const) char *cmdedit_prompt;
 static const char *cmdedit_prompt;
@@ -6060,7 +6060,7 @@
 }
 #endif
 
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 #define setvimode(on) do { \
 	if (on) line_input_state->flags |= VI_MODE; \
 	else line_input_state->flags &= ~VI_MODE; \
@@ -6077,11 +6077,11 @@
 	parsenextc = buf;
 
 retry:
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 	if (!iflag || parsefile->fd)
 		nr = safe_read(parsefile->fd, buf, BUFSIZ - 1);
 	else {
-#if ENABLE_FEATURE_COMMAND_TAB_COMPLETION
+#if ENABLE_FEATURE_TAB_COMPLETION
 		line_input_state->path_lookup = pathval();
 #endif
 		nr = read_line_input(cmdedit_prompt, buf, BUFSIZ, line_input_state);
@@ -7916,7 +7916,7 @@
 	monitor(4, etext, profile_buf, sizeof profile_buf, 50);
 #endif
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 	line_input_state = new_line_input_t(FOR_SHELL | WITH_PATH_LOOKUP);
 #endif
 	state = 0;
@@ -7960,7 +7960,7 @@
 	init();
 	setstackmark(&smark);
 	procargs(argc, argv);
-#if ENABLE_FEATURE_COMMAND_SAVEHISTORY
+#if ENABLE_FEATURE_EDITING_SAVEHISTORY
 	if (iflag) {
 		const char *hp = lookupvar("HISTFILE");
 
@@ -8001,7 +8001,7 @@
 		evalstring(minusc, 0);
 
 	if (sflag || minusc == NULL) {
-#if ENABLE_FEATURE_COMMAND_SAVEHISTORY
+#if ENABLE_FEATURE_EDITING_SAVEHISTORY
 		if ( iflag ) {
 			const char *hp = lookupvar("HISTFILE");
 

Modified: trunk/busybox/shell/cmdedit.c
===================================================================
--- trunk/busybox/shell/cmdedit.c	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/shell/cmdedit.c	2007-01-22 09:03:07 UTC (rev 17451)
@@ -38,9 +38,9 @@
 
 #ifdef TEST
 
-#define ENABLE_FEATURE_COMMAND_EDITING 0
-#define ENABLE_FEATURE_COMMAND_TAB_COMPLETION 0
-#define ENABLE_FEATURE_COMMAND_USERNAME_COMPLETION 0
+#define ENABLE_FEATURE_EDITING 0
+#define ENABLE_FEATURE_TAB_COMPLETION 0
+#define ENABLE_FEATURE_USERNAME_COMPLETION 0
 #define ENABLE_FEATURE_NONPRINTABLE_INVERSE_PUT 0
 #define ENABLE_FEATURE_CLEAN_UP 0
 
@@ -48,7 +48,7 @@
 
 
 /* Entire file (except TESTing part) sits inside this #if */
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 
 #if ENABLE_LOCALE_SUPPORT
 #define Isprint(c) isprint(c)
@@ -57,7 +57,7 @@
 #endif
 
 #define ENABLE_FEATURE_GETUSERNAME_AND_HOMEDIR \
-(ENABLE_FEATURE_COMMAND_USERNAME_COMPLETION || ENABLE_FEATURE_SH_FANCY_PROMPT)
+(ENABLE_FEATURE_USERNAME_COMPLETION || ENABLE_FEATURE_EDITING_FANCY_PROMPT)
 
 
 static line_input_t *state;
@@ -75,7 +75,7 @@
 static char *command_ps;
 static const char *cmdedit_prompt;
 
-#if ENABLE_FEATURE_SH_FANCY_PROMPT
+#if ENABLE_FEATURE_EDITING_FANCY_PROMPT
 static char *hostname_buf;
 static int num_ok_lines = 1;
 #endif
@@ -85,7 +85,7 @@
 static char *home_pwd_buf = "";
 #endif
 
-#if ENABLE_FEATURE_COMMAND_TAB_COMPLETION
+#if ENABLE_FEATURE_TAB_COMPLETION
 static int my_uid;
 static int my_gid;
 #endif
@@ -208,7 +208,7 @@
 	input_backward(back_cursor);
 }
 
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 #define DELBUFSIZ 128
 static char *delbuf;  /* a (malloced) place to store deleted characters */
 static char *delp;
@@ -224,7 +224,7 @@
 	if (j == command_len)
 		return;
 
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 	if (save) {
 		if (newdelflag) {
 			if (!delbuf)
@@ -245,7 +245,7 @@
 	input_backward(cursor - j);     /* back to old pos cursor */
 }
 
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 static void put(void)
 {
 	int ocursor;
@@ -280,7 +280,7 @@
 }
 
 
-#if ENABLE_FEATURE_COMMAND_TAB_COMPLETION
+#if ENABLE_FEATURE_TAB_COMPLETION
 
 static char **matches;
 static unsigned num_matches;
@@ -305,7 +305,7 @@
 	num_matches++;
 }
 
-#if ENABLE_FEATURE_COMMAND_USERNAME_COMPLETION
+#if ENABLE_FEATURE_USERNAME_COMPLETION
 static void username_tab_completion(char *ud, char *with_shash_flg)
 {
 	struct passwd *entry;
@@ -431,7 +431,7 @@
 	} else {
 		/* dirbuf = ".../.../.../" */
 		safe_strncpy(dirbuf, command, (pfind - command) + 2);
-#if ENABLE_FEATURE_COMMAND_USERNAME_COMPLETION
+#if ENABLE_FEATURE_USERNAME_COMPLETION
 		if (dirbuf[0] == '~')   /* ~/... or ~user/... */
 			username_tab_completion(dirbuf, dirbuf);
 #endif
@@ -749,7 +749,7 @@
 		/* Free up any memory already allocated */
 		free_tab_completion_data();
 
-#if ENABLE_FEATURE_COMMAND_USERNAME_COMPLETION
+#if ENABLE_FEATURE_USERNAME_COMPLETION
 		/* If the word starts with `~' and there is no slash in the word,
 		 * then try completing this word as a username. */
 		if (state->flags & USERNAME_COMPLETION)
@@ -874,7 +874,7 @@
 	return 0;
 }
 
-#if ENABLE_FEATURE_COMMAND_SAVEHISTORY
+#if ENABLE_FEATURE_EDITING_SAVEHISTORY
 /* state->flags is already checked to be nonzero */
 void load_history(const char *fromfile)
 {
@@ -952,7 +952,7 @@
 	state->cnt_history = i;
 	if (state->flags & SAVE_HISTORY)
 		save_history(state->hist_file);
-	USE_FEATURE_SH_FANCY_PROMPT(num_ok_lines++;)
+	USE_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines++;)
 }
 
 #else /* MAX_HISTORY == 0 */
@@ -977,7 +977,7 @@
  * vi mode implemented 2005 by Paul Fox <pgf at foxharp.boston.ma.us>
  */
 
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 static void
 vi_Word_motion(char *command, int eat)
 {
@@ -1076,7 +1076,7 @@
  * read_line_input and its helpers
  */
 
-#if !ENABLE_FEATURE_SH_FANCY_PROMPT
+#if !ENABLE_FEATURE_EDITING_FANCY_PROMPT
 static void parse_prompt(const char *prmt_ptr)
 {
 	cmdedit_prompt = prmt_ptr;
@@ -1246,7 +1246,7 @@
 
 /* leave out the "vi-mode"-only case labels if vi editing isn't
  * configured. */
-#define vi_case(caselabel) USE_FEATURE_COMMAND_EDITING(case caselabel)
+#define vi_case(caselabel) USE_FEATURE_EDITING(case caselabel)
 
 /* convert uppercase ascii to equivalent control char, for readability */
 #undef CTRL
@@ -1260,7 +1260,7 @@
 	unsigned int ic;
 	unsigned char c;
 	smallint break_out = 0;
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 	smallint vi_cmdmode = 0;
 	smalluint prevc;
 #endif
@@ -1309,7 +1309,7 @@
 		}
 	}
 #endif
-#if ENABLE_FEATURE_COMMAND_TAB_COMPLETION
+#if ENABLE_FEATURE_TAB_COMPLETION
 	my_uid = getuid();
 	my_gid = getgid();
 #endif
@@ -1326,7 +1326,7 @@
 
 		ic = c;
 
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 		newdelflag = 1;
 		if (vi_cmdmode)
 			ic |= vbit;
@@ -1453,7 +1453,7 @@
 				input_backspace();
 			break;
 
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 		case 'i'|vbit:
 			vi_cmdmode = 0;
 			break;
@@ -1584,7 +1584,7 @@
 
 		case '\x1b': /* ESC */
 
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 			if (state->flags & VI_MODE) {
 				/* ESC: insert mode --> command mode */
 				vi_cmdmode = 1;
@@ -1612,7 +1612,7 @@
 			}
 
 			switch (c) {
-#if ENABLE_FEATURE_COMMAND_TAB_COMPLETION
+#if ENABLE_FEATURE_TAB_COMPLETION
 			case '\t':                      /* Alt-Tab */
 				input_tab(&lastWasTab);
 				break;
@@ -1679,7 +1679,7 @@
 			} else
 #endif
 
-#if ENABLE_FEATURE_COMMAND_EDITING_VI
+#if ENABLE_FEATURE_EDITING_VI
 			if (vi_cmdmode)  /* Don't self-insert */
 				break;
 #endif
@@ -1722,11 +1722,11 @@
 		command[command_len] = '\0';
 	}
 
-#if ENABLE_FEATURE_CLEAN_UP && ENABLE_FEATURE_COMMAND_TAB_COMPLETION
+#if ENABLE_FEATURE_CLEAN_UP && ENABLE_FEATURE_TAB_COMPLETION
 	free_tab_completion_data();
 #endif
 
-#if ENABLE_FEATURE_SH_FANCY_PROMPT
+#if ENABLE_FEATURE_EDITING_FANCY_PROMPT
 	free((char*)cmdedit_prompt);
 #endif
 	/* restore initial_settings */
@@ -1772,7 +1772,7 @@
 {
 	char buff[BUFSIZ];
 	char *prompt =
-#if ENABLE_FEATURE_SH_FANCY_PROMPT
+#if ENABLE_FEATURE_EDITING_FANCY_PROMPT
 		"\\[\\033[32;1m\\]\\u@\\[\\x1b[33;1m\\]\\h:"
 		"\\[\\033[34;1m\\]\\w\\[\\033[35;1m\\] "
 		"\\!\\[\\e[36;1m\\]\\$ \\[\\E[0m\\]";

Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/shell/hush.c	2007-01-22 09:03:07 UTC (rev 17451)
@@ -854,7 +854,7 @@
 
 static void cmdedit_set_initial_prompt(void)
 {
-#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
+#if !ENABLE_FEATURE_EDITING_FANCY_PROMPT
 	PS1 = NULL;
 #else
 	PS1 = getenv("PS1");
@@ -866,7 +866,7 @@
 static void setup_prompt_string(int promptmode, char **prompt_str)
 {
 	debug_printf("setup_prompt_string %d ",promptmode);
-#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
+#if !ENABLE_FEATURE_EDITING_FANCY_PROMPT
 	/* Set up the prompt */
 	if (promptmode == 1) {
 		free(PS1);
@@ -882,7 +882,7 @@
 	debug_printf("result %s\n",*prompt_str);
 }
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 static line_input_t *line_input_state;
 #endif
 
@@ -892,7 +892,7 @@
 	static char the_command[BUFSIZ];
 
 	setup_prompt_string(i->promptmode, &prompt_str);
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 	/*
 	 ** enable command line editing only while a command line
 	 ** is actually being read; otherwise, we'll end up bequeathing
@@ -1109,7 +1109,7 @@
 		 * really dislike relying on /proc for things.  We could exec ourself
 		 * from global_argv[0], but if we are in a chroot, we may not be able
 		 * to find ourself... */
-#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
+#if ENABLE_FEATURE_SH_STANDALONE_SHELL
 		{
 			int argc_l;
 			char** argv_l=child->argv;
@@ -2650,7 +2650,7 @@
 	FILE *input;
 	char **e = environ;
 
-#ifdef CONFIG_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 	line_input_state = new_line_input_t(FOR_SHELL);
 #endif
 
@@ -2672,7 +2672,8 @@
 
 	/* Initialize some more globals to non-zero values */
 	set_cwd();
-	if (ENABLE_FEATURE_COMMAND_EDITING) cmdedit_set_initial_prompt();
+	if (ENABLE_FEATURE_EDITING)
+		cmdedit_set_initial_prompt();
 	else PS1 = NULL;
 	PS2 = "> ";
 
@@ -2738,7 +2739,7 @@
 	debug_printf("\ninteractive=%d\n", interactive);
 	if (interactive) {
 		/* Looks like they want an interactive shell */
-#ifndef CONFIG_FEATURE_SH_EXTRA_QUIET
+#if !ENABLE_FEATURE_SH_EXTRA_QUIET
 		printf( "\n\n%s hush - the humble shell v0.01 (testing)\n",
 			BB_BANNER);
 		printf( "Enter 'help' for a list of built-in commands.\n\n");
@@ -2757,7 +2758,7 @@
 	input = xfopen(argv[optind], "r");
 	opt = parse_file_outer(input);
 
-#ifdef CONFIG_FEATURE_CLEAN_UP
+#if ENABLE_FEATURE_CLEAN_UP
 	fclose(input);
 	if (cwd && cwd != bb_msg_unknown)
 		free((char*)cwd);

Modified: trunk/busybox/shell/lash.c
===================================================================
--- trunk/busybox/shell/lash.c	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/shell/lash.c	2007-01-22 09:03:07 UTC (rev 17451)
@@ -365,7 +365,7 @@
 	res = putenv(v);
 	if (res)
 		bb_perror_msg("export");
-#ifdef CONFIG_FEATURE_SH_FANCY_PROMPT
+#ifdef CONFIG_FEATURE_EDITING_FANCY_PROMPT
 	if (strncmp(v, "PS1=", 4)==0)
 		PS1 = getenv("PS1");
 #endif
@@ -613,7 +613,7 @@
 
 static inline void cmdedit_set_initial_prompt(void)
 {
-#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
+#if !ENABLE_FEATURE_EDITING_FANCY_PROMPT
 	PS1 = NULL;
 #else
 	PS1 = getenv("PS1");
@@ -624,7 +624,7 @@
 
 static inline void setup_prompt_string(char **prompt_str)
 {
-#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
+#if !ENABLE_FEATURE_EDITING_FANCY_PROMPT
 	/* Set up the prompt */
 	if (shell_context == 0) {
 		free(PS1);
@@ -639,7 +639,7 @@
 #endif
 }
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 static line_input_t *line_input_state;
 #endif
 
@@ -661,7 +661,7 @@
 	if (source == stdin) {
 		setup_prompt_string(&prompt_str);
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 		/*
 		** enable command line editing only while a command line
 		** is actually being read; otherwise, we'll end up bequeathing
@@ -1507,7 +1507,7 @@
 	argc = argc_l;
 	argv = argv_l;
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 	line_input_state = new_line_input_t(FOR_SHELL);
 #endif
 
@@ -1572,7 +1572,7 @@
 
 	if (ENABLE_FEATURE_CLEAN_UP) atexit(free_memory);
 
-	if (ENABLE_FEATURE_COMMAND_EDITING) cmdedit_set_initial_prompt();
+	if (ENABLE_FEATURE_EDITING) cmdedit_set_initial_prompt();
 	else PS1 = NULL;
 
 	return (busy_loop(input));

Modified: trunk/busybox/shell/msh.c
===================================================================
--- trunk/busybox/shell/msh.c	2007-01-22 08:54:13 UTC (rev 17450)
+++ trunk/busybox/shell/msh.c	2007-01-22 09:03:07 UTC (rev 17451)
@@ -58,7 +58,7 @@
 #endif							/* MSHDEBUG */
 
 
-#ifdef CONFIG_FEATURE_SH_FANCY_PROMPT
+#if ENABLE_FEATURE_EDITING_FANCY_PROMPT
 # define DEFAULT_ROOT_PROMPT "\\u:\\w> "
 # define DEFAULT_USER_PROMPT "\\u:\\w$ "
 #else
@@ -776,7 +776,7 @@
 #endif							/* MSHDEBUG */
 
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 static char *current_prompt;
 #endif
 
@@ -786,7 +786,7 @@
  */
 
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 static line_input_t *line_input_state;
 #endif
 
@@ -798,7 +798,7 @@
 	char *name, **ap;
 	int (*iof) (struct ioarg *);
 
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 	line_input_state = new_line_input_t(FOR_SHELL);
 #endif
 
@@ -847,7 +847,7 @@
 #endif
 
 	prompt = lookup("PS1");
-#ifdef CONFIG_FEATURE_SH_FANCY_PROMPT
+#if ENABLE_FEATURE_EDITING_FANCY_PROMPT
 	if (prompt->value == null)
 #endif
 		setval(prompt, DEFAULT_USER_PROMPT);
@@ -856,7 +856,7 @@
 		prompt->status &= ~EXPORT;
 	}
 	cprompt = lookup("PS2");
-#ifdef CONFIG_FEATURE_SH_FANCY_PROMPT
+#if ENABLE_FEATURE_EDITING_FANCY_PROMPT
 	if (cprompt->value == null)
 #endif
 		setval(cprompt, "> ");
@@ -929,7 +929,7 @@
 		PUSHIO(afile, 0, iof);
 		if (isatty(0) && isatty(1) && !cflag) {
 			interactive++;
-#ifndef CONFIG_FEATURE_SH_EXTRA_QUIET
+#if !ENABLE_FEATURE_SH_EXTRA_QUIET
 #ifdef MSHDEBUG
 			printf("\n\n%s Built-in shell (msh with debug)\n", BB_BANNER);
 #else
@@ -971,7 +971,7 @@
 
 	for (;;) {
 		if (interactive && e.iop <= iostack) {
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 			current_prompt = prompt->value;
 #else
 			prs(prompt->value);
@@ -2378,7 +2378,7 @@
 		startl = 1;
 		if (multiline || cf & CONTIN) {
 			if (interactive && e.iop <= iostack) {
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 				current_prompt = cprompt->value;
 #else
 				prs(cprompt->value);
@@ -2439,7 +2439,7 @@
 			return YYERRCODE;
 		}
 		if (interactive && c == '\n' && e.iop <= iostack) {
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 			current_prompt = cprompt->value;
 #else
 			prs(cprompt->value);
@@ -3289,7 +3289,7 @@
 			col = 0;
 		}
 	}
-#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
+#if ENABLE_FEATURE_SH_STANDALONE_SHELL
 	{
 		int i;
 		const struct BB_applet *applet;
@@ -4673,7 +4673,7 @@
 					return e.iop->prev = 0;
 				}
 				if (interactive && e.iop == iostack + 1) {
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 					current_prompt = prompt->value;
 #else
 					prs(prompt->value);
@@ -4905,7 +4905,7 @@
 		ap->afpos++;
 		return *bp->bufp++ & 0177;
 	}
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 	if (interactive && isatty(ap->afile)) {
 		static char mycommand[BUFSIZ];
 		static int position = 0, size = 0;
@@ -5156,7 +5156,7 @@
 		e.iobase = e.iop;
 		for (;;) {
 			if (interactive && e.iop <= iostack) {
-#if ENABLE_FEATURE_COMMAND_EDITING
+#if ENABLE_FEATURE_EDITING
 				current_prompt = cprompt->value;
 #else
 				prs(cprompt->value);




More information about the busybox-cvs mailing list