xiaoxiang781216 commented on code in PR #3168:
URL: https://github.com/apache/nuttx-apps/pull/3168#discussion_r2312742550


##########
nshlib/nsh_command.c:
##########
@@ -1228,6 +1233,31 @@ int nsh_command(FAR struct nsh_vtbl_s *vtbl, int argc, 
FAR char *argv[])
 
   cmd = argv[0];
 
+#ifdef CONFIG_NSH_BUILTIN_AS_COMMAND

Review Comment:
   let's move the following change before line 1298:
   ```
   #ifdef CONFIG_NSH_BUILTIN_AS_COMMAND
   if (handler == cmd_unrecognized)
     {
        int index = builtin_isavail(cmd);
        if (Index >= 0)
          {
             const struct builtin_s *builtin = builtin_for_index(index);
             if (builtin != NULL)
               {
                 handler = builtin->main;
               }
          }
     }
   #endif
   ```



##########
nshlib/nsh_command.c:
##########
@@ -1228,6 +1233,31 @@ int nsh_command(FAR struct nsh_vtbl_s *vtbl, int argc, 
FAR char *argv[])
 
   cmd = argv[0];
 
+#ifdef CONFIG_NSH_BUILTIN_AS_COMMAND
+  /* Check if the command is available in the builtin list */
+
+  index = builtin_isavail(cmd);
+
+  if (index > 0)
+    {
+      /* Get the builtin structure by index */
+
+      builtin = builtin_for_index(index);
+      if (builtin != NULL)
+        {
+          is_builtin_cmd = true;
+        }
+    }
+
+  if (is_builtin_cmd)

Review Comment:
   why restore back is_builtin_cmd



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to