summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2006-07-27 16:11:19 +0200
committerStefan Roese <sr@denx.de>2006-07-27 16:11:19 +0200
commit3ca9122feccee939904f1dbc8a422cfb1533785f (patch)
tree8af2f6c6394d3e641ad584694e7f793f95565b52 /common
parent4819fad905138095bf8502f80fc65124f2d4e2ac (diff)
downloadu-boot-imx-3ca9122feccee939904f1dbc8a422cfb1533785f.zip
u-boot-imx-3ca9122feccee939904f1dbc8a422cfb1533785f.tar.gz
u-boot-imx-3ca9122feccee939904f1dbc8a422cfb1533785f.tar.bz2
Fix CONFIG_CMDLINE_EDITING implementation
Patch by Stefan Roese, 27 Jul 2006
Diffstat (limited to 'common')
-rw-r--r--common/main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/common/main.c b/common/main.c
index ef28b3f..3788bd5 100644
--- a/common/main.c
+++ b/common/main.c
@@ -53,7 +53,6 @@ extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
#define MAX_DELAY_STOP_STR 32
-static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen);
static int parse_line (char *, char *[]);
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
static int abortboot(int);
@@ -63,8 +62,11 @@ static int abortboot(int);
char console_buffer[CFG_CBSIZE]; /* console I/O buffer */
+#ifndef CONFIG_CMDLINE_EDITING
+static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen);
static char erase_seq[] = "\b \b"; /* erase sequence */
static char tab_seq[] = " "; /* used to expand TABs */
+#endif /* CONFIG_CMDLINE_EDITING */
#ifdef CONFIG_BOOT_RETRY_TIME
static uint64_t endtime = 0; /* must be set, default is instant timeout */
@@ -641,6 +643,7 @@ static char* hist_next(void)
return (ret);
}
+#ifndef CONFIG_CMDLINE_EDITING
static void cread_print_hist_list(void)
{
int i;
@@ -659,6 +662,7 @@ static void cread_print_hist_list(void)
i++;
}
}
+#endif /* CONFIG_CMDLINE_EDITING */
#define BEGINNING_OF_LINE() { \
while (num) { \
@@ -942,7 +946,8 @@ int readline (const char *const prompt)
puts (prompt);
- return cread_line(p, &len);
+ cread_line(p, &len);
+ return len;
#else
char *p = console_buffer;
int n = 0; /* buffer index */
@@ -1044,6 +1049,7 @@ int readline (const char *const prompt)
/****************************************************************************/
+#ifndef CONFIG_CMDLINE_EDITING
static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen)
{
char *s;
@@ -1073,6 +1079,7 @@ static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen)
(*np)--;
return (p);
}
+#endif /* CONFIG_CMDLINE_EDITING */
/****************************************************************************/