fix the second bug for 1>text.txt pipe

svn path=/trunk/; revision=16567
This commit is contained in:
Magnus Olsen 2005-07-14 20:51:39 +00:00
parent 3a00c096a3
commit 2032b01e66

View file

@ -128,7 +128,51 @@ INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags
*ofn++ = *sp++; *ofn++ = *sp++;
*ofn = _T('\0'); *ofn = _T('\0');
} }
else if ((*sp == _T('1')) || (*sp == _T('2')))
else if (*sp == _T('1'))
{
/* error redirection */
sp++;
if (*sp == _T('>'))
{
/* output redirection */
*lpnFlags |= OUTPUT_REDIRECTION;
sp++;
/* append request ? */
if (*sp == _T('>'))
{
*lpnFlags |= OUTPUT_APPEND;
sp++;
}
while (_istspace (*sp))
sp++;
/* copy file name */
while (*sp && !IsRedirection (*sp) && !_istspace (*sp))
*ofn++ = *sp++;
*ofn = _T('\0');
}
else
{
/* no redirection!! copy the '1' character! */
sp--;
*dp++ = *sp++;
continue;
}
while (_istspace (*sp))
sp++;
/* copy file name */
while (*sp && !IsRedirection (*sp) && !_istspace (*sp))
*efn++ = *sp++;
*efn = _T('\0');
}
else if (*sp == _T('2'))
{ {
/* error redirection */ /* error redirection */
sp++; sp++;
@ -147,7 +191,7 @@ INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags
} }
else else
{ {
/* no redirection!! copy the '1' or '2' character! */ /* no redirection!! copy the '2' character! */
sp--; sp--;
*dp++ = *sp++; *dp++ = *sp++;
continue; continue;