This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 49941f1d5 cmd_date:Set optind to zero in the error case.
49941f1d5 is described below

commit 49941f1d5730743bf67e3f022ce35982124702e0
Author: yangguangcai <yangguang...@xiaomi.com>
AuthorDate: Sun Feb 18 17:12:19 2024 +0800

    cmd_date:Set optind to zero in the error case.
    
    Signed-off-by: yangguangcai <yangguang...@xiaomi.com>
---
 nshlib/nsh_timcmds.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/nshlib/nsh_timcmds.c b/nshlib/nsh_timcmds.c
index a806e97a9..e34dd7fba 100644
--- a/nshlib/nsh_timcmds.c
+++ b/nshlib/nsh_timcmds.c
@@ -434,6 +434,7 @@ int cmd_date(FAR struct nsh_vtbl_s *vtbl, int argc, FAR 
char **argv)
   return ret;
 
 errout:
+  optind = 0;
   nsh_error(vtbl, errfmt, argv[0]);
   return ERROR;
 }

Reply via email to