summaryrefslogtreecommitdiff
path: root/nuttx/binfmt/binfmt_loadmodule.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-19 22:18:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-19 22:18:30 +0000
commit1fb830e24ef8b48e1134cd7bcd1d835195ceca81 (patch)
treed8042aaa7325712cbdc8afaeab8f6928ce915e76 /nuttx/binfmt/binfmt_loadmodule.c
parent1f5151d2c5574cbb57e57ea32416ca8970e0dec4 (diff)
downloadnuttx-1fb830e24ef8b48e1134cd7bcd1d835195ceca81.tar.gz
nuttx-1fb830e24ef8b48e1134cd7bcd1d835195ceca81.tar.bz2
nuttx-1fb830e24ef8b48e1134cd7bcd1d835195ceca81.zip
Verify PATH variable in apps/examples/elf
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5445 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/binfmt/binfmt_loadmodule.c')
-rw-r--r--nuttx/binfmt/binfmt_loadmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nuttx/binfmt/binfmt_loadmodule.c b/nuttx/binfmt/binfmt_loadmodule.c
index 8a691edc7..112a6b35b 100644
--- a/nuttx/binfmt/binfmt_loadmodule.c
+++ b/nuttx/binfmt/binfmt_loadmodule.c
@@ -146,11 +146,11 @@ int load_module(FAR struct binary_s *bin)
#endif
{
/* Were we given a relative path? Or an absolute path to the file to
- * be loaded.
+ * be loaded? Absolute paths start with '/'.
*/
#ifdef CONFIG_BINFMT_EXEPATH
- if (bin->filename[0] == '/')
+ if (bin->filename[0] != '/')
{
FAR const char *relpath;
FAR char *fullpath;
@@ -168,7 +168,7 @@ int load_module(FAR struct binary_s *bin)
{
/* Get the next absolute file path */
- while ((fullpath = exepath_next(handle, relpath)))
+ while ((fullpath = exepath_next(handle, relpath)) != NULL)
{
/* Try to load the file at this path */