Small unicode safe changes by me. Small msvc build error fix by jvangael@wisc.edu. Modified: trunk/reactos/subsys/system/cmd/console.c Modified: trunk/reactos/subsys/system/cmd/misc.c _____
Modified: trunk/reactos/subsys/system/cmd/console.c --- trunk/reactos/subsys/system/cmd/console.c 2005-11-01 16:17:25 UTC (rev 18932) +++ trunk/reactos/subsys/system/cmd/console.c 2005-11-01 17:01:36 UTC (rev 18933) @@ -178,7 +178,7 @@
&dwWritten, NULL); WriteFile (GetStdHandle (nStdHandle), - "\n", + _T("\n"), 1, &dwWritten, NULL); @@ -294,7 +294,7 @@ for(i = 0; i < len; i++) {
- if(pBuf[i] == '\n') + if(pBuf[i] == _T('\n')) { LineCount++; CharEL=0; @@ -306,7 +306,7 @@ { if (i+1<len) { - if(pBuf[i+1] != '\n') LineCount++; + if(pBuf[i+1] != _T('\n')) LineCount++; } CharEL=0; } @@ -316,8 +316,8 @@ WriteFile (GetStdHandle (nStdHandle),&pBuf[i],sizeof(CHAR),&dwWritten,NULL); if(LineCount >= ScreenLines) { - if(strnicmp(&pBuf[i], "\n", 2)!=0) - WriteFile (GetStdHandle (nStdHandle),"\n",sizeof(CHAR),&dwWritten,NULL); + if(_tcsnicmp(&pBuf[i], _T("\n"), 2)!=0) + WriteFile (GetStdHandle (nStdHandle),_T("\n"),sizeof(CHAR),&dwWritten,NULL);
if(PagePrompt() != PROMPT_YES) { _____
Modified: trunk/reactos/subsys/system/cmd/misc.c --- trunk/reactos/subsys/system/cmd/misc.c 2005-11-01 16:17:25 UTC (rev 18932) +++ trunk/reactos/subsys/system/cmd/misc.c 2005-11-01 17:01:36 UTC (rev 18933) @@ -74,11 +74,11 @@
VOID GetPathCase( TCHAR * Path, TCHAR * OutPath) { INT i = 0; - _tcscpy(OutPath, _T("")); TCHAR TempPath[MAX_PATH]; WIN32_FIND_DATA FindFileData; HANDLE hFind; _tcscpy(TempPath, _T("")); + _tcscpy(OutPath, _T(""));
for(i = 0; i < _tcslen(Path); i++) @@ -206,7 +206,7 @@ return FALSE; } memcpy(dirpart, pattern, pathend - pattern + 1); - dirpart[pathend - pattern + 1] = '\0'; + dirpart[pathend - pattern + 1] = _T('\0'); } else { @@ -427,7 +427,7 @@ ReadFile(hFile, &ch, 1, &dwRead, NULL) && dwRead) { lpString[len++] = ch; - if ((ch == '\n') || (ch == '\r')) + if ((ch == _T('\n')) || (ch == _T('\r'))) { /* break at new line*/ break; @@ -437,7 +437,7 @@ if (!dwRead && !len) return FALSE;
- lpString[len++] = '\0'; + lpString[len++] = _T('\0'); #ifdef _UNICODE MultiByteToWideChar(CP_ACP, 0, lpString, len, lpBuffer, len); free(lpString); @@ -466,7 +466,7 @@ ConInEnable ();
if ((ir.Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE) || - ((ir.Event.KeyEvent.wVirtualKeyCode == 'C') && + ((ir.Event.KeyEvent.wVirtualKeyCode == _T('C')) && (ir.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)))) return PROMPT_BREAK;
@@ -606,7 +606,7 @@ ConInEnable ();
if ((ir.Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE) || - ((ir.Event.KeyEvent.wVirtualKeyCode == 'C') && + ((ir.Event.KeyEvent.wVirtualKeyCode == _T('C')) && (ir.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)))) return PROMPT_BREAK;