]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/main.c
Merge with /home/m8/git/u-boot
[karo-tx-uboot.git] / common / main.c
index 7ce9b75f907e3d642cb4242519929a17d0394fa4..f042f3a636fd6171ce2f96c6f8a15b49fb33169b 100644 (file)
@@ -26,7 +26,9 @@
 #include <common.h>
 #include <watchdog.h>
 #include <command.h>
-#include <malloc.h>
+#ifdef CONFIG_MODEM_SUPPORT
+#include <malloc.h>            /* for free() prototype */
+#endif
 
 #ifdef CFG_HUSH_PARSER
 #include <hush.h>
@@ -345,7 +347,7 @@ void main_loop (void)
 #ifdef CONFIG_MODEM_SUPPORT
        debug ("DEBUG: main_loop:   do_mdm_init=%d\n", do_mdm_init);
        if (do_mdm_init) {
-               uchar *str = strdup(getenv("mdm_cmd"));
+               char *str = strdup(getenv("mdm_cmd"));
                setenv ("preboot", str);  /* set or delete definition */
                if (str != NULL)
                        free (str);
@@ -432,7 +434,7 @@ void main_loop (void)
            s = getenv("menucmd");
            if (s) {
 # ifndef CFG_HUSH_PARSER
-               run_command (s, bd, 0);
+               run_command (s, 0);
 # else
                parse_string_outer(s, FLAG_PARSE_SEMICOLON |
                                    FLAG_EXIT_FROM_LOOP);
@@ -726,8 +728,8 @@ static void process_macros (const char *input, char *output)
        int inputcnt  = strlen (input);
        int outputcnt = CFG_CBSIZE;
        int state = 0;  /* 0 = waiting for '$'  */
-                       /* 1 = waiting for '('  */
-                       /* 2 = waiting for ')'  */
+                       /* 1 = waiting for '(' or '{' */
+                       /* 2 = waiting for ')' or '}' */
                        /* 3 = waiting for '''  */
 #ifdef DEBUG_PARSER
        char *output_start = output;
@@ -765,7 +767,7 @@ static void process_macros (const char *input, char *output)
                }
                break;
            case 1:                     /* Waiting for (        */
-               if (c == '(') {
+               if (c == '(' || c == '{') {
                        state++;
                        varname_start = input;
                } else {
@@ -780,7 +782,7 @@ static void process_macros (const char *input, char *output)
                }
                break;
            case 2:                     /* Waiting for )        */
-               if (c == ')') {
+               if (c == ')' || c == '}') {
                        int i;
                        char envname[CFG_CBSIZE], *envval;
                        int envcnt = input-varname_start-1; /* Varname # of chars */