Author: greatlrd
Date: Thu Apr 17 19:56:01 2008
New Revision: 33014
URL:
http://svn.reactos.org/svn/reactos?rev=33014&view=rev
Log:
fixed pipe working again from cmd
more investigate are need it to figout who to really solv bat and pipe and gui apps issue
so none regress and working fine in all case. rember gui apps can resive pipe from cmd or
send to cmd
Modified:
trunk/reactos/base/shell/cmd/cmd.c
Modified: trunk/reactos/base/shell/cmd/cmd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=3…
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] Thu Apr 17 19:56:01 2008
@@ -810,18 +810,9 @@
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
- if (bc)
- {
- /* will fail for windows gui apps */
- num = 0;
- bc->hBatchFile = INVALID_HANDLE_VALUE;
- }
- else
- {
- LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
- ConErrPrintf(szMsg, in);
- return;
- }
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
+ ConErrPrintf(szMsg, in);
+ return;
}
if (!SetStdHandle (STD_INPUT_HANDLE, hFile))
@@ -900,7 +891,7 @@
/* Now set up the end conditions... */
/* redirect STDOUT */
- if ((bc) && (bc->hBatchFile != INVALID_HANDLE_VALUE) && (out[0]))
+ if (out[0])
{
/* Final output to here */
HANDLE hFile;
@@ -967,7 +958,7 @@
}
/* redirect STDERR */
- if ((bc) && (bc->hBatchFile != INVALID_HANDLE_VALUE) && (err[0]))
+ if (err[0])
{
/* Final output to here */
HANDLE hFile;
@@ -1173,23 +1164,15 @@
if (position)
{
position += 2;
- if (_tcschr(position, _T(',')) != NULL)
+ Token = _tcstok(position, _T(","));
+ while ((Token != NULL) && (i < 2))
{
- Token = _tcstok(position, _T(","));
- while ((Token != NULL) && (i < 2))
- {
- StringPart[i] = _ttoi(Token);
- i++;
- Token = _tcstok (NULL, _T(","));
- }
- if (i > 0)
- {
- if (StringPart[1] < 0)
- StringPart[1] = _tcslen(ret + StringPart[0]) + StringPart[1];
- _tcsncpy(ReturnValue, ret + StringPart[0], StringPart[1]);
- _tcscpy(ret, ReturnValue);
- }
+ StringPart[i] = _ttoi(Token);
+ i++;
+ Token = _tcstok (NULL, _T(","));
}
+ _tcsncpy(ReturnValue, ret + StringPart[0], StringPart[1]);
+ _tcscpy(ret, ReturnValue);
return ret;
}
else