aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-02-16 20:26:50 +0000
committerEric Andersen <andersen@codepoet.org>2001-02-16 20:26:50 +0000
commit28a78ab62c011820d91ab9edc5ae45196d813a13 (patch)
tree44eb3e8aa958a10328d81adac45a47d94ef63f27 /shell
parent6faae7deb4b88dccffb7dbbf267315cb7bbc0af9 (diff)
downloadbusybox-w32-28a78ab62c011820d91ab9edc5ae45196d813a13.tar.gz
busybox-w32-28a78ab62c011820d91ab9edc5ae45196d813a13.tar.bz2
busybox-w32-28a78ab62c011820d91ab9edc5ae45196d813a13.zip
Several features were hard coded on. Stop that. List tab completion
as working (thanks Vladimir!) and taking 4k. -Erik
Diffstat (limited to 'shell')
-rw-r--r--shell/cmdedit.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 6fd80fd21..097918925 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -41,12 +41,8 @@
41 41
42#else 42#else
43 43
44#define BB_FEATURE_SH_COMMAND_EDITING 44//#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
45#define BB_FEATURE_SH_TAB_COMPLETION 45//#define BB_FEATURE_BASH_STYLE_PROMT
46#define BB_FEATURE_USERNAME_COMPLETION
47#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
48#define BB_FEATURE_BASH_STYLE_PROMT
49#define BB_FEATURE_CLEAN_UP
50 46
51#define TRUE 1 47#define TRUE 1
52#define FALSE 0 48#define FALSE 0
@@ -57,10 +53,10 @@
57#ifdef BB_FEATURE_SH_COMMAND_EDITING 53#ifdef BB_FEATURE_SH_COMMAND_EDITING
58 54
59#ifndef BB_FEATURE_SH_TAB_COMPLETION 55#ifndef BB_FEATURE_SH_TAB_COMPLETION
60#undef BB_FEATURE_USERNAME_COMPLETION 56#undef BB_FEATURE_SH_USERNAME_COMPLETION
61#endif 57#endif
62 58
63#if defined(BB_FEATURE_USERNAME_COMPLETION) || defined(BB_FEATURE_BASH_STYLE_PROMT) 59#if defined(BB_FEATURE_SH_USERNAME_COMPLETION) || defined(BB_FEATURE_BASH_STYLE_PROMT)
64#define BB_FEATURE_GETUSERNAME_AND_HOMEDIR 60#define BB_FEATURE_GETUSERNAME_AND_HOMEDIR
65#endif 61#endif
66 62
@@ -626,7 +622,7 @@ static int is_execute(const struct stat *st)
626 return FALSE; 622 return FALSE;
627} 623}
628 624
629#ifdef BB_FEATURE_USERNAME_COMPLETION 625#ifdef BB_FEATURE_SH_USERNAME_COMPLETION
630 626
631static char **username_tab_completion(char *ud, int *num_matches) 627static char **username_tab_completion(char *ud, int *num_matches)
632{ 628{
@@ -688,7 +684,7 @@ static char **username_tab_completion(char *ud, int *num_matches)
688 return (matches); 684 return (matches);
689 } 685 }
690} 686}
691#endif /* BB_FEATURE_USERNAME_COMPLETION */ 687#endif /* BB_FEATURE_SH_USERNAME_COMPLETION */
692 688
693enum { 689enum {
694 FIND_EXE_ONLY = 0, 690 FIND_EXE_ONLY = 0,
@@ -785,7 +781,7 @@ static char **exe_n_cwd_tab_completion(char *command, int *num_matches,
785 strcpy(dirbuf, command); 781 strcpy(dirbuf, command);
786 /* set dir only */ 782 /* set dir only */
787 dirbuf[(pfind - command) + 1] = 0; 783 dirbuf[(pfind - command) + 1] = 0;
788#ifdef BB_FEATURE_USERNAME_COMPLETION 784#ifdef BB_FEATURE_SH_USERNAME_COMPLETION
789 if (dirbuf[0] == '~') /* ~/... or ~user/... */ 785 if (dirbuf[0] == '~') /* ~/... or ~user/... */
790 username_tab_completion(dirbuf, 0); 786 username_tab_completion(dirbuf, 0);
791#endif 787#endif
@@ -1066,7 +1062,7 @@ static void input_tab(int *lastWasTab)
1066 /* Free up any memory already allocated */ 1062 /* Free up any memory already allocated */
1067 input_tab(0); 1063 input_tab(0);
1068 1064
1069#ifdef BB_FEATURE_USERNAME_COMPLETION 1065#ifdef BB_FEATURE_SH_USERNAME_COMPLETION
1070 /* If the word starts with `~' and there is no slash in the word, 1066 /* If the word starts with `~' and there is no slash in the word,
1071 * then try completing this word as a username. */ 1067 * then try completing this word as a username. */
1072 1068