]> git.sur5r.net Git - u-boot/blobdiff - common/hush.c
zlib: updated to v.1.2.3
[u-boot] / common / hush.c
index 67bed39aafa1f2a1bb3d847681aecd5cd81a2fce..528dd254a5064cf6c45c00f9b8689858222de306 100644 (file)
@@ -96,7 +96,6 @@
 /*cmd_boot.c*/
 extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);      /* do_bootd */
 #endif
-#ifdef CFG_HUSH_PARSER
 #ifndef __U_BOOT__
 #include <ctype.h>     /* isalpha, isdigit */
 #include <unistd.h>    /* getpid */
@@ -1019,9 +1018,9 @@ static void get_user_input(struct in_str *i)
        fflush(stdout);
        i->p = the_command;
 #else
-       extern char console_buffer[CFG_CBSIZE];
+       extern char console_buffer[CONFIG_SYS_CBSIZE];
        int n;
-       static char the_command[CFG_CBSIZE];
+       static char the_command[CONFIG_SYS_CBSIZE];
 
 #ifdef CONFIG_BOOT_RETRY_TIME
 #  ifdef CONFIG_RESET_TO_RETRY
@@ -1033,9 +1032,9 @@ static void get_user_input(struct in_str *i)
 #endif
        i->__promptme = 1;
        if (i->promptmode == 1) {
-               n = readline(CFG_PROMPT);
+               n = readline(CONFIG_SYS_PROMPT);
        } else {
-               n = readline(CFG_PROMPT_HUSH_PS2);
+               n = readline(CONFIG_SYS_PROMPT_HUSH_PS2);
        }
 #ifdef CONFIG_BOOT_RETRY_TIME
        if (n == -2) {
@@ -1075,7 +1074,7 @@ static void get_user_input(struct in_str *i)
        else {
                if (console_buffer[0] != '\n') {
                        if (strlen(the_command) + strlen(console_buffer)
-                           < CFG_CBSIZE) {
+                           < CONFIG_SYS_CBSIZE) {
                                n = strlen(the_command);
                                the_command[n-1] = ' ';
                                strcpy(&the_command[n],console_buffer);
@@ -1696,7 +1695,7 @@ static int run_pipe_real(struct pipe *pi)
 #endif
                                /* found - check max args */
                                if ((child->argc - i) > cmdtp->maxargs) {
-                                       printf ("Usage:\n%s\n", cmdtp->usage);
+                                       cmd_usage(cmdtp);
                                        return -1;
                                }
 #endif
@@ -2003,7 +2002,7 @@ static int free_pipe(struct pipe *pi, int indent)
 #ifndef __U_BOOT__
                        globfree(&child->glob_result);
 #else
-                       for (a = child->argc;a >= 0;a--) {
+                       for (a = 0; a < child->argc; a++) {
                                free(child->argv[a]);
                        }
                                        free(child->argv);
@@ -3624,13 +3623,12 @@ int do_showvar (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 U_BOOT_CMD(
-       showvar, CFG_MAXARGS, 1,        do_showvar,
-       "showvar- print local hushshell variables\n",
+       showvar, CONFIG_SYS_MAXARGS, 1, do_showvar,
+       "print local hushshell variables",
        "\n    - print values of all hushshell variables\n"
        "showvar name ...\n"
-       "    - print value of hushshell variable 'name'\n"
+       "    - print value of hushshell variable 'name'"
 );
 
 #endif
-#endif /* CFG_HUSH_PARSER */
 /****************************************************************************/