summaryrefslogtreecommitdiff
path: root/nuttx/examples
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-11 20:16:17 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-11 20:16:17 +0000
commitdf9cb3ba59cdd40da994ff9ab6b153ef12875d9e (patch)
tree471c2407efefc9c4489c365c2cd55b162f8bf0c8 /nuttx/examples
parent1924debc29cbc64094cf41bbdf878c6c53dd4d7b (diff)
downloadpx4-nuttx-df9cb3ba59cdd40da994ff9ab6b153ef12875d9e.tar.gz
px4-nuttx-df9cb3ba59cdd40da994ff9ab6b153ef12875d9e.tar.bz2
px4-nuttx-df9cb3ba59cdd40da994ff9ab6b153ef12875d9e.zip
Fix nsh/apps bug
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3367 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples')
-rw-r--r--nuttx/examples/nsh/nsh_main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/nuttx/examples/nsh/nsh_main.c b/nuttx/examples/nsh/nsh_main.c
index 680267e43..f9a34f0a1 100644
--- a/nuttx/examples/nsh/nsh_main.c
+++ b/nuttx/examples/nsh/nsh_main.c
@@ -492,12 +492,18 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, int argc, char *argv[])
}
}
+ /* If the command was not found, then try to execute the command from
+ * a list of pre-built applications.
+ */
+
#ifdef CONFIG_EXAMPLES_NSH_BUILTIN_APPS
- if (handler == cmd_unrecognized)
+ if (handler == cmd_unrecognized && nsh_execapp(vtbl, cmd, argv) == OK)
{
- /* Try to execute the command from a list of pre-built applications. */
+ /* The pre-built application was successfully started -- run OK.
+ * If not, then fall through to execute the cmd_nrecognized handler.
+ */
- return nsh_execapp(vtbl, cmd, argv);
+ return OK;
}
#endif