mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 06:02:56 +00:00
Made cmd unicode compatible.
svn path=/trunk/; revision=16898
This commit is contained in:
parent
dc648e2083
commit
dce178cf7c
4 changed files with 51 additions and 46 deletions
|
@ -266,7 +266,12 @@ VOID ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdH
|
||||||
|
|
||||||
|
|
||||||
//get the size of the visual screen that can be printed too
|
//get the size of the visual screen that can be printed too
|
||||||
GetConsoleScreenBufferInfo(hConsole, &csbi);
|
if (!GetConsoleScreenBufferInfo(hConsole, &csbi))
|
||||||
|
{
|
||||||
|
// we assuming its a file handle
|
||||||
|
ConPrintf(szFormat, arg_ptr, nStdHandle);
|
||||||
|
return;
|
||||||
|
}
|
||||||
//subtract 2 to account for "press any key..." and for the blank line at the end of PagePrompt()
|
//subtract 2 to account for "press any key..." and for the blank line at the end of PagePrompt()
|
||||||
ScreenLines = (csbi.srWindow.Bottom - csbi.srWindow.Top) - 4;
|
ScreenLines = (csbi.srWindow.Bottom - csbi.srWindow.Top) - 4;
|
||||||
ScreenCol = (csbi.srWindow.Right - csbi.srWindow.Left) + 1;
|
ScreenCol = (csbi.srWindow.Right - csbi.srWindow.Left) + 1;
|
||||||
|
@ -289,7 +294,7 @@ VOID ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdH
|
||||||
for(i = 0; i < len; i++)
|
for(i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(szOut[i] == _T('\n'))
|
if(pBuf[i] == '\n')
|
||||||
{
|
{
|
||||||
LineCount++;
|
LineCount++;
|
||||||
CharEL=0;
|
CharEL=0;
|
||||||
|
@ -301,18 +306,18 @@ VOID ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdH
|
||||||
{
|
{
|
||||||
if (i+1<len)
|
if (i+1<len)
|
||||||
{
|
{
|
||||||
if(szOut[i+1] != _T('\n')) LineCount++;
|
if(pBuf[i+1] != '\n') LineCount++;
|
||||||
}
|
}
|
||||||
CharEL=0;
|
CharEL=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME : write more that one char at time */
|
/* FIXME : write more that one char at time */
|
||||||
WriteFile (GetStdHandle (nStdHandle),&pBuf[i],sizeof(TCHAR),&dwWritten,NULL);
|
WriteFile (GetStdHandle (nStdHandle),&pBuf[i],sizeof(CHAR),&dwWritten,NULL);
|
||||||
if(LineCount >= ScreenLines)
|
if(LineCount >= ScreenLines)
|
||||||
{
|
{
|
||||||
if(_tcsncicmp(&szOut[i],_T("\n"),2)!=0)
|
if(strnicmp(&pBuf[i], "\n", 2)!=0)
|
||||||
WriteFile (GetStdHandle (nStdHandle),_T("\n"),sizeof(TCHAR),&dwWritten,NULL);
|
WriteFile (GetStdHandle (nStdHandle),"\n",sizeof(CHAR),&dwWritten,NULL);
|
||||||
|
|
||||||
if(PagePrompt() != PROMPT_YES)
|
if(PagePrompt() != PROMPT_YES)
|
||||||
{
|
{
|
||||||
|
|
|
@ -321,7 +321,7 @@ static INT Overwrite (LPTSTR fn)
|
||||||
INT res;
|
INT res;
|
||||||
LoadString(CMD_ModuleHandle, STRING_COPY_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
LoadString(CMD_ModuleHandle, STRING_COPY_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||||
ConOutPrintf(szMsg,fn);
|
ConOutPrintf(szMsg,fn);
|
||||||
res = FilePromptYNA ("");
|
res = FilePromptYNA (_T(""));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -833,7 +833,7 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param)
|
||||||
nFiles++;
|
nFiles++;
|
||||||
/* only print source name when more then one file */
|
/* only print source name when more then one file */
|
||||||
if(_tcschr (arg[nSrc], _T('+')) != NULL || _tcschr (arg[nSrc], _T('*')) != NULL)
|
if(_tcschr (arg[nSrc], _T('+')) != NULL || _tcschr (arg[nSrc], _T('*')) != NULL)
|
||||||
ConOutPrintf("%s\n",findBuffer.cFileName);
|
ConOutPrintf(_T("%s\n"),findBuffer.cFileName);
|
||||||
//LoadString(CMD_ModuleHandle, STRING_MOVE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
//LoadString(CMD_ModuleHandle, STRING_MOVE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -17,7 +17,7 @@ int main (int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef _UNICODE
|
#ifdef _UNICODE
|
||||||
return _main(void);
|
return _main();
|
||||||
#else
|
#else
|
||||||
return _main(argc, argv);
|
return _main(argc, argv);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -60,7 +60,7 @@ static INT Overwrite (LPTSTR fn)
|
||||||
INT res;
|
INT res;
|
||||||
LoadString(CMD_ModuleHandle, STRING_MOVE_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
LoadString(CMD_ModuleHandle, STRING_MOVE_HELP1, szMsg, RC_STRING_MAX_SIZE);
|
||||||
ConOutPrintf(szMsg,fn);
|
ConOutPrintf(szMsg,fn);
|
||||||
res = FilePromptYNA ("");
|
res = FilePromptYNA (_T(""));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue