summaryrefslogtreecommitdiff
path: root/nuttx/examples/nsh/nsh_netcmds.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-06 15:44:41 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-09-06 15:44:41 +0000
commit77598342d00348e0b97f05b2c6735bdf8dde8e33 (patch)
treea6d10071812c10e0221dc7a8d15d603f9e4b1ad8 /nuttx/examples/nsh/nsh_netcmds.c
parentbf15faf28c3826541af41632784beaefdb9a2254 (diff)
downloadnuttx-77598342d00348e0b97f05b2c6735bdf8dde8e33.tar.gz
nuttx-77598342d00348e0b97f05b2c6735bdf8dde8e33.tar.bz2
nuttx-77598342d00348e0b97f05b2c6735bdf8dde8e33.zip
TFTP Get integration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@885 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nsh/nsh_netcmds.c')
-rw-r--r--nuttx/examples/nsh/nsh_netcmds.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/nuttx/examples/nsh/nsh_netcmds.c b/nuttx/examples/nsh/nsh_netcmds.c
index 33eeb9966..3bc0d1e7e 100644
--- a/nuttx/examples/nsh/nsh_netcmds.c
+++ b/nuttx/examples/nsh/nsh_netcmds.c
@@ -389,6 +389,7 @@ errout:
int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
struct tftpc_args_s args;
+ char *fullpath;
/* Parse the input parameter list */
@@ -397,9 +398,13 @@ int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
return ERROR;
}
+ /* Get the full path to the local file */
+
+ fullpath = nsh_getfullpath(vtbl, args.srcpath);
+
/* Then perform the TFTP get operation */
- if (tftpget(args.srcpath, args.destpath, args.ipaddr, args.binary) != OK)
+ if (tftpget(args.srcpath, fullpath, args.ipaddr, args.binary) != OK)
{
nsh_output(vtbl, g_fmtcmdfailed, argv[0], "tftpget", NSH_ERRNO);
}
@@ -410,6 +415,7 @@ int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
free(args.destpath);
}
+ free(fullpath);
return OK;
}
#endif