mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
fix the second bug for 1>text.txt pipe
svn path=/trunk/; revision=16567
This commit is contained in:
parent
3a00c096a3
commit
2032b01e66
1 changed files with 46 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue