]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_misc.c
reset optind before executing command
[z180-stamp.git] / avr / cmd_misc.c
index a0ee26e7afedafd9e91b59f3a273d072bc66007f..72102c66c46e82788cd314a9a85a18a4585e5904 100644 (file)
@@ -7,11 +7,10 @@
  * SPDX-License-Identifier:    GPL-2.0
  */
 
-#include "common.h"
+#include "cmd_misc.h"
 #include "eval_arg.h"
 #include <stdbool.h>
 
-#include "command.h"
 #include "timer.h"
 #include "con-utils.h"
 #include "getopt-min.h"
@@ -23,9 +22,6 @@ command_ret_t do_echo(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * cons
 
        (void) cmdtp; (void) flag;
 
-       /* reset getopt() */
-       optind = 0;
-
        int opt;
        while ((opt = getopt(argc, argv, PSTR("n"))) != -1) {
                switch (opt) {