]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_fat.c
Remove xmalloc.c, fix potential 0-pointer derefenrence in cli.c.
[z180-stamp.git] / avr / cmd_fat.c
index 2257ddc66a55ecacc4c6ea35592189ef722a7213..76304bc069f6f0210d70c96ba15eb429f0e19f41 100644 (file)
@@ -9,11 +9,7 @@
  */
 
 #include "cmd_fat.h"
-#include "common.h"
-#include <string.h>
-#include <stdbool.h>
 
-#include "command.h"
 #include "ff.h"
 #include "z80-if.h"
 #include "eval_arg.h"
@@ -536,10 +532,7 @@ command_ret_t do_rw(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const
 }
 
 
-static
-command_ret_t do_help(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[]);
-
-cmd_tbl_t cmd_fat_sub[] = {
+cmd_tbl_t cmd_tbl_fat[] = {
 CMD_TBL_ITEM(
        stat,   2,      CTBL_REPEAT,    do_stat,
        "Show logical drive status",
@@ -594,34 +587,19 @@ CMD_TBL_ITEM(
 #ifdef  CONFIG_SYS_LONGHELP
        FSTR(""),
 #endif /* CONFIG_SYS_LONGHELP */
+       NULL,
 #ifdef CONFIG_AUTO_COMPLETE
-       0,
+       NULL,
 #endif
 },
+/* Mark end of table */
+CMD_TBL_END(cmd_tbl_fat)
 };
 
-static
-command_ret_t do_help(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
-{
-       return _do_help(cmd_fat_sub, ARRAY_SIZE(cmd_fat_sub), cmdtp, flag, argc, argv);
-}
-
 
 command_ret_t do_fat(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
 {
-       cmd_tbl_t *cp;
-
-       if (argc < 2)
-               return CMD_RET_USAGE;
-
-       /* drop initial "fat" arg */
-       argc--;
-       argv++;
-
-       cp = find_cmd_tbl(argv[0], cmd_fat_sub, ARRAY_SIZE(cmd_fat_sub));
-
-       if (cp)
-               return cp->cmd(cmdtp, flag, argc, argv);
+       puts_P(PSTR("Huch?"));
 
        return CMD_RET_USAGE;
 }