Erich Hoover : wcmd: Fix redirecting a pipe to another pipe.

Alexandre Julliard julliard at winehq.org
Tue Jan 13 10:56:41 CST 2009


Module: wine
Branch: master
Commit: 8defde719af8e51aaf2581f022b707593170c915
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8defde719af8e51aaf2581f022b707593170c915

Author: Erich Hoover <ehoover at mines.edu>
Date:   Sun Jan 11 13:08:50 2009 -0700

wcmd: Fix redirecting a pipe to another pipe.

---

 programs/cmd/wcmdmain.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 595dbc8..2366fc7 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1871,6 +1871,13 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF
                 }
 
                 curCopyTo[(*curLen)++] = *curPos;
+
+                /* If a redirect is immediately followed by '&' (ie. 2>&1) then
+                    do not process that ampersand as an AND operator */
+                if (thisChar == '>' && *(curPos+1) == '&') {
+                    curCopyTo[(*curLen)++] = *(curPos+1);
+                    curPos++;
+                }
                 break;
 
       case '|': /* Pipe character only if not || */




More information about the wine-cvs mailing list