summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-01-16 07:30:15 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-01-16 07:30:15 -0600
commit4473883c0a6707090b82ea875f82a6e67f64c763 (patch)
tree78b71d6ac8f0c5a8580a57bab1b045236d7c8bf3
parent12028015e8205daec6be01b779ad04565c0f52b2 (diff)
downloadnuttx-4473883c0a6707090b82ea875f82a6e67f64c763.tar.gz
nuttx-4473883c0a6707090b82ea875f82a6e67f64c763.tar.bz2
nuttx-4473883c0a6707090b82ea875f82a6e67f64c763.zip
NSH: Fix redirection of output to a file. That was broken with recent changes
-rw-r--r--apps/ChangeLog.txt2
-rw-r--r--apps/nshlib/nsh_parse.c6
-rw-r--r--nuttx/TODO14
3 files changed, 19 insertions, 3 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index 749d90b16..b5b343e37 100644
--- a/apps/ChangeLog.txt
+++ b/apps/ChangeLog.txt
@@ -779,3 +779,5 @@
* apps/system/inifile: A simple INI file parser (perhaps too simple).
This is code that I wrote a long time ago and have used many time but
is untested in its current incarnation (2014-1-15).
+ * aps/nshlib/nsh_parse.c: Recent changes broke redirection of output
+ (2014-1-14).
diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c
index 4ac6980df..c7ef521a1 100644
--- a/apps/nshlib/nsh_parse.c
+++ b/apps/nshlib/nsh_parse.c
@@ -1216,12 +1216,12 @@ static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, FAR char **saveptr,
if (*(pbegin + 1) == '>')
{
*saveptr = pbegin + 2;
- pbegin = (char*)g_redirect2;
+ argument = (FAR char *)g_redirect2;
}
else
{
*saveptr = pbegin + 1;
- pbegin = (char*)g_redirect1;
+ argument = (FAR char *)g_redirect1;
}
}
@@ -1232,7 +1232,7 @@ static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, FAR char **saveptr,
/* Return NULL meaning that we are at the end of the line */
*saveptr = pbegin;
- pbegin = NULL;
+ argument = NULL;
}
/* Otherwise, it is a normal argument and we have to parse using the normal
diff --git a/nuttx/TODO b/nuttx/TODO
index 829ad95b4..bdeef40d1 100644
--- a/nuttx/TODO
+++ b/nuttx/TODO
@@ -1236,6 +1236,20 @@ o File system / Generic drivers (fs/, drivers/)
insensitivity to upper/lowercase file names seem to be not
consistent in our usage - which can result in creating two
directories with the same name..."
+
+ Example using NSH:
+
+ nsh> echo "Test1" >/tmp/AtEsT.tXt
+ nsh> echo "Test2" >/tmp/aTeSt.TxT
+ nsh> ls /tmp
+ /tmp:
+ AtEsT.tXt
+ aTeSt.TxT
+ nsh> cat /tmp/aTeSt.TxT
+ Test2
+ nsh> cat /tmp/AtEsT.tXt
+ Test1
+
Status: Open
Priority: Low