cmd: Avoid reading garbage when looking for redirection handle.
This commit is contained in:
parent
bbdaed2f33
commit
93a68fa659
|
@ -1354,11 +1354,10 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
|
||||||
while (redir != NULL && ((p = strchrW(redir,'>')) != NULL)) {
|
while (redir != NULL && ((p = strchrW(redir,'>')) != NULL)) {
|
||||||
int handle = 0;
|
int handle = 0;
|
||||||
|
|
||||||
if (*(p-1)!='2') {
|
if (p > redir && (*(p-1)=='2'))
|
||||||
handle = 1;
|
|
||||||
} else {
|
|
||||||
handle = 2;
|
handle = 2;
|
||||||
}
|
else
|
||||||
|
handle = 1;
|
||||||
|
|
||||||
p++;
|
p++;
|
||||||
if ('>' == *p) {
|
if ('>' == *p) {
|
||||||
|
|
Loading…
Reference in New Issue