summaryrefslogtreecommitdiff
path: root/avr/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'avr/cli.c')
-rw-r--r--avr/cli.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/avr/cli.c b/avr/cli.c
index 44cf5b8..4b77499 100644
--- a/avr/cli.c
+++ b/avr/cli.c
@@ -296,15 +296,10 @@ int run_command_list(const char *cmd, int len)
/****************************************************************************/
-#define DYN_BUFFER 1
void cli_loop(void)
{
-#if DYN_BUFFER
char *lastcommand = NULL;
-#else
- static char lastcommand[CONFIG_SYS_CBSIZE];
-#endif
int len;
int flag;
int rc = 1;
@@ -314,15 +309,11 @@ void cli_loop(void)
flag = 0; /* assume no special flags for now */
if (len > 0) {
-#if DYN_BUFFER
lastcommand = (char *) xrealloc(lastcommand, len+1);
if (lastcommand != NULL) {
strncpy(lastcommand, console_buffer, len+1);
lastcommand[len] = '\0';
}
-#else
- strcpy(lastcommand, console_buffer);
-#endif
} else if (len == 0)
flag |= CMD_FLAG_REPEAT;
@@ -333,12 +324,8 @@ void cli_loop(void)
if (rc <= 0) {
/* invalid command or not repeatable, forget it */
-#if DYN_BUFFER
free(lastcommand);
lastcommand = NULL;
-#else
- lastcommand[0] = 0;
-#endif
}
}
}