summaryrefslogtreecommitdiff
path: root/avr/cli.c
diff options
context:
space:
mode:
authorLeo C2014-08-31 22:37:26 +0200
committerLeo C2014-08-31 22:37:26 +0200
commitf76ca346168afe6cf68127934765a61bd477380e (patch)
tree8c0904fc0ed9dd59be329afc497956fe38e0cbd5 /avr/cli.c
parent55027f3b53e5250768632efdd470c9e938e883e7 (diff)
downloadz180-stamp-f76ca346168afe6cf68127934765a61bd477380e.zip
$() expansion deleted (only ${}). setenv_ulong(), setenv_hex()
Diffstat (limited to 'avr/cli.c')
-rw-r--r--avr/cli.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/avr/cli.c b/avr/cli.c
index be5df40..08e7038 100644
--- a/avr/cli.c
+++ b/avr/cli.c
@@ -56,8 +56,8 @@ static void process_macros(const char *input, char *output)
#endif
uint_fast8_t state = 0; /* 0 = waiting for '$' */
- /* 1 = waiting for '(' or '{' */
- /* 2 = waiting for ')' or '}' */
+ /* 1 = waiting for '{' */
+ /* 2 = waiting for '}' */
/* 3 = waiting for ''' */
char *output_start = output;
@@ -94,7 +94,7 @@ static void process_macros(const char *input, char *output)
}
break;
case 1: /* Waiting for ( */
- if (c == '(' || c == '{') {
+ if (c == '{') {
state++;
varname_start = input;
} else {
@@ -109,7 +109,7 @@ static void process_macros(const char *input, char *output)
}
break;
case 2: /* Waiting for ) */
- if (c == ')' || c == '}') {
+ if (c == '}') {
char envname[CONFIG_SYS_ENV_NAMELEN+1], *envval;
/* Varname # of chars */
uint_fast8_t envcnt = input - varname_start - 1;
@@ -153,13 +153,21 @@ static void process_macros(const char *input, char *output)
strlen(output_start), output_start);
}
- /*
+/**
+ *
+ *
* WARNING:
*
* We must create a temporary copy of the command since the command we get
* may be the result from getenv(), which returns a pointer directly to
* the environment data, which may change magicly when the command we run
* creates or modifies environment variables (like "bootp" does).
+ *
+ *
+ * @param cmd
+ * @param flag
+ * @returns
+ *
*/
static int cli_run_command(const char *cmd, int flag)
{
@@ -173,7 +181,7 @@ static int cli_run_command(const char *cmd, int flag)
uint_fast8_t inquotes, repeatable = 1;
int rc = 0;
- debug_parser("[RUN_COMMAND] cmd[%p]=\"%s\"\n",
+ debug_parser("[RUN_COMMAND] cmd[%p]=\"%s\"\n",
cmd, cmd ? cmd : "NULL");
clear_ctrlc(); /* forget any previous Control C */
@@ -290,7 +298,7 @@ static int run_command_repeatable(const char *cmd, int flag)
int run_command_list(const char *cmd, int len)
{
(void) len;
-
+
return cli_run_command_list(cmd);
}