mirror of
https://github.com/reactos/reactos.git
synced 2024-07-06 04:35:07 +00:00
[DBGPRINT]
Convert TABs to spaces. svn path=/trunk/; revision=63697
This commit is contained in:
parent
d3be6e62e8
commit
e3f91f127c
|
@ -16,109 +16,109 @@
|
|||
|
||||
int _tmain(int argc, TCHAR ** argv)
|
||||
{
|
||||
TCHAR * buf;
|
||||
int bufsize;
|
||||
int i;
|
||||
int offset;
|
||||
TCHAR * buf;
|
||||
int bufsize;
|
||||
int i;
|
||||
int offset;
|
||||
|
||||
bufsize = 0;
|
||||
for(i = 1; i < argc; i++)
|
||||
{
|
||||
bufsize += _tcslen(argv[i]) + 1;
|
||||
}
|
||||
bufsize = 0;
|
||||
for(i = 1; i < argc; i++)
|
||||
{
|
||||
bufsize += _tcslen(argv[i]) + 1;
|
||||
}
|
||||
|
||||
if (!bufsize)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (!bufsize)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (_tcsstr(argv[1], "--winetest") && (argc == 3))
|
||||
{
|
||||
char psBuffer[128];
|
||||
char psBuffer2[128];
|
||||
char *nlptr2;
|
||||
char cmd[255];
|
||||
char test[300];
|
||||
FILE *pPipe;
|
||||
FILE *pPipe2;
|
||||
if (_tcsstr(argv[1], "--winetest") && (argc == 3))
|
||||
{
|
||||
char psBuffer[128];
|
||||
char psBuffer2[128];
|
||||
char *nlptr2;
|
||||
char cmd[255];
|
||||
char test[300];
|
||||
FILE *pPipe;
|
||||
FILE *pPipe2;
|
||||
|
||||
/* get available tests */
|
||||
pPipe = _tpopen(argv[2], "r");
|
||||
if (pPipe != NULL)
|
||||
{
|
||||
while(fgets(psBuffer, 128, pPipe))
|
||||
{
|
||||
if (psBuffer[0] == ' ')
|
||||
{
|
||||
strcpy(cmd, argv[2]);
|
||||
strcat(cmd, " ");
|
||||
strcat(cmd, psBuffer+4);
|
||||
/* run the current test */
|
||||
strcpy(test, "\n\nRunning ");
|
||||
strcat(test, cmd);
|
||||
OutputDebugStringA(test);
|
||||
pPipe2 = _popen(cmd, "r");
|
||||
if (pPipe2 != NULL)
|
||||
{
|
||||
while(fgets(psBuffer2, 128, pPipe2))
|
||||
{
|
||||
nlptr2 = strchr(psBuffer2, '\n');
|
||||
if (nlptr2)
|
||||
*nlptr2 = '\0';
|
||||
puts(psBuffer2);
|
||||
OutputDebugStringA(psBuffer2);
|
||||
}
|
||||
_pclose(pPipe2);
|
||||
}
|
||||
}
|
||||
}
|
||||
_pclose(pPipe);
|
||||
}
|
||||
}
|
||||
else if (_tcsstr(argv[1], "--process") && (argc == 3))
|
||||
{
|
||||
char psBuffer[128];
|
||||
FILE *pPipe;
|
||||
/* get available tests */
|
||||
pPipe = _tpopen(argv[2], "r");
|
||||
if (pPipe != NULL)
|
||||
{
|
||||
while(fgets(psBuffer, 128, pPipe))
|
||||
{
|
||||
if (psBuffer[0] == ' ')
|
||||
{
|
||||
strcpy(cmd, argv[2]);
|
||||
strcat(cmd, " ");
|
||||
strcat(cmd, psBuffer+4);
|
||||
/* run the current test */
|
||||
strcpy(test, "\n\nRunning ");
|
||||
strcat(test, cmd);
|
||||
OutputDebugStringA(test);
|
||||
pPipe2 = _popen(cmd, "r");
|
||||
if (pPipe2 != NULL)
|
||||
{
|
||||
while(fgets(psBuffer2, 128, pPipe2))
|
||||
{
|
||||
nlptr2 = strchr(psBuffer2, '\n');
|
||||
if (nlptr2)
|
||||
*nlptr2 = '\0';
|
||||
puts(psBuffer2);
|
||||
OutputDebugStringA(psBuffer2);
|
||||
}
|
||||
_pclose(pPipe2);
|
||||
}
|
||||
}
|
||||
}
|
||||
_pclose(pPipe);
|
||||
}
|
||||
}
|
||||
else if (_tcsstr(argv[1], "--process") && (argc == 3))
|
||||
{
|
||||
char psBuffer[128];
|
||||
FILE *pPipe;
|
||||
|
||||
pPipe = _tpopen(argv[2], "r");
|
||||
if (pPipe != NULL)
|
||||
{
|
||||
while(fgets(psBuffer, 128, pPipe))
|
||||
{
|
||||
puts(psBuffer);
|
||||
OutputDebugStringA(psBuffer);
|
||||
}
|
||||
_pclose(pPipe);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buf = HeapAlloc(GetProcessHeap(), 0, (bufsize+1) * sizeof(TCHAR));
|
||||
if (!buf)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
pPipe = _tpopen(argv[2], "r");
|
||||
if (pPipe != NULL)
|
||||
{
|
||||
while(fgets(psBuffer, 128, pPipe))
|
||||
{
|
||||
puts(psBuffer);
|
||||
OutputDebugStringA(psBuffer);
|
||||
}
|
||||
_pclose(pPipe);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buf = HeapAlloc(GetProcessHeap(), 0, (bufsize+1) * sizeof(TCHAR));
|
||||
if (!buf)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
offset = 0;
|
||||
for(i = 1; i < argc; i++)
|
||||
{
|
||||
int length = _tcslen(argv[i]);
|
||||
_tcsncpy(&buf[offset], argv[i], length);
|
||||
offset += length;
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
buf[offset] = _T(' ');
|
||||
}
|
||||
else
|
||||
{
|
||||
buf[offset] = _T('\n');
|
||||
buf[offset+1] = _T('\0');
|
||||
}
|
||||
offset++;
|
||||
}
|
||||
_putts(buf);
|
||||
OutputDebugString(buf);
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
}
|
||||
return 0;
|
||||
offset = 0;
|
||||
for(i = 1; i < argc; i++)
|
||||
{
|
||||
int length = _tcslen(argv[i]);
|
||||
_tcsncpy(&buf[offset], argv[i], length);
|
||||
offset += length;
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
buf[offset] = _T(' ');
|
||||
}
|
||||
else
|
||||
{
|
||||
buf[offset] = _T('\n');
|
||||
buf[offset+1] = _T('\0');
|
||||
}
|
||||
offset++;
|
||||
}
|
||||
_putts(buf);
|
||||
OutputDebugString(buf);
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue