From dd9c8ab4f9df66dd464dbdeba94a16bedb3f2ee9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 16 Jan 2014 07:30:15 -0600 Subject: [PATCH] NSH: Fix redirection of output to a file. That was broken with recent changes --- ChangeLog.txt | 2 ++ nshlib/nsh_parse.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 749d90b16..b5b343e37 100644 --- a/ChangeLog.txt +++ b/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/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index 4ac6980df..c7ef521a1 100644 --- a/nshlib/nsh_parse.c +++ b/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