cmd: Avoid reading garbage when looking for redirection handle.

This commit is contained in:
Frédéric Delanoy 2011-08-27 02:11:31 +02:00 committed by Alexandre Julliard
parent bbdaed2f33
commit 93a68fa659
1 changed files with 3 additions and 4 deletions

View File

@ -1354,11 +1354,10 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
while (redir != NULL && ((p = strchrW(redir,'>')) != NULL)) {
int handle = 0;
if (*(p-1)!='2') {
handle = 1;
} else {
if (p > redir && (*(p-1)=='2'))
handle = 2;
}
else
handle = 1;
p++;
if ('>' == *p) {