diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-05 18:53:46 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-05 18:53:46 +0000 |
commit | 260b4435a85b9f4ae5d70830c1259af7afee256f (patch) | |
tree | 37aac92ff9a19ef32dc04b0d9d70c24a8233a278 /apps/netutils/ftpc/ftpc_listdir.c | |
parent | 672c0505c6c10c227c9315ed4f94746462392ea5 (diff) | |
download | nuttx-260b4435a85b9f4ae5d70830c1259af7afee256f.tar.gz nuttx-260b4435a85b9f4ae5d70830c1259af7afee256f.tar.bz2 nuttx-260b4435a85b9f4ae5d70830c1259af7afee256f.zip |
More FTP fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3672 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/netutils/ftpc/ftpc_listdir.c')
-rw-r--r-- | apps/netutils/ftpc/ftpc_listdir.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/netutils/ftpc/ftpc_listdir.c b/apps/netutils/ftpc/ftpc_listdir.c index e3af9b122..1bfda8234 100644 --- a/apps/netutils/ftpc/ftpc_listdir.c +++ b/apps/netutils/ftpc/ftpc_listdir.c @@ -341,12 +341,15 @@ FAR struct ftpc_dirlist_s *ftpc_listdir(SESSION handle, /* Count the number of names in the temporary file */ rewind(filestream); + nnames = 0; + ftpc_nlstparse(filestream, ftpc_dircount, &nnames); if (!nnames) { ndbg("Nothing found in directory\n"); goto errout; } + nvdbg("nnames: %d\n", nnames); /* Allocate and initialize a directory container */ @@ -357,12 +360,13 @@ FAR struct ftpc_dirlist_s *ftpc_listdir(SESSION handle, ndbg("Failed to allocate dirlist\n"); goto errout; } - dirlist->nnames = 0; /* Then copy all of the directory strings into the container */ rewind(filestream); - ftpc_nlstparse(filestream, ftpc_dircount, &nnames); + dirlist->nnames = 0; + + ftpc_nlstparse(filestream, ftpc_addname, dirlist); DEBUGASSERT(nnames == dirlist->nnames); } |