Revers the change after reboot it did carcgh for me hole time. Modified: trunk/reactos/subsys/system/cmd/cmd.c Modified: trunk/reactos/subsys/system/cmd/cmd.h Modified: trunk/reactos/subsys/system/cmd/cmdinput.c _____
Modified: trunk/reactos/subsys/system/cmd/cmd.c --- trunk/reactos/subsys/system/cmd/cmd.c 2005-09-04 11:26:09 UTC (rev 17632) +++ trunk/reactos/subsys/system/cmd/cmd.c 2005-09-04 11:31:54 UTC (rev 17633) @@ -1037,14 +1037,13 @@
ProcessInput (BOOL bFlag) { TCHAR commandline[CMDLINE_LENGTH]; - TCHAR *readline = NULL; + TCHAR readline[CMDLINE_LENGTH]; LPTSTR tp = NULL; LPTSTR ip; LPTSTR cp; BOOL bEchoThisLine; - - readline = malloc(CMDLINE_LENGTH * sizeof(TCHAR));
+ do { /* if no batch input then... */ @@ -1053,7 +1052,7 @@ if (bFlag) return 0;
- readline = ReadCommand (readline, CMDLINE_LENGTH); + ReadCommand (readline, CMDLINE_LENGTH); ip = readline; bEchoThisLine = FALSE; } _____
Modified: trunk/reactos/subsys/system/cmd/cmd.h --- trunk/reactos/subsys/system/cmd/cmd.h 2005-09-04 11:26:09 UTC (rev 17632) +++ trunk/reactos/subsys/system/cmd/cmd.h 2005-09-04 11:31:54 UTC (rev 17633) @@ -106,7 +106,7 @@
/* Prototypes for CMDINPUT.C */ -TCHAR * ReadCommand (LPTSTR, INT); +VOID ReadCommand (LPTSTR, INT);
/* Prototypes for CMDTABLE.C */ _____
Modified: trunk/reactos/subsys/system/cmd/cmdinput.c --- trunk/reactos/subsys/system/cmd/cmdinput.c 2005-09-04 11:26:09 UTC (rev 17632) +++ trunk/reactos/subsys/system/cmd/cmdinput.c 2005-09-04 11:31:54 UTC (rev 17633) @@ -124,7 +124,7 @@
/* read in a command line */ -TCHAR * ReadCommand (LPTSTR str, INT maxlen) +VOID ReadCommand (LPTSTR str, INT maxlen) { SHORT orgx; /* origin x/y */ SHORT orgy; @@ -508,15 +508,10 @@ default: #ifdef _UNICODE ch = ir.Event.KeyEvent.uChar.UnicodeChar; - charcount ++; - str = realloc(str, charcount); - - if ((ch >= 32 && ch <= 255)) + if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2))) #else - ch = ir.Event.KeyEvent.uChar.AsciiChar; - str = realloc(str, 2 + current * sizeof(TCHAR)); - - if ((UCHAR)ch >= 32 ) + ch = ir.Event.KeyEvent.uChar.AsciiChar; + if ((UCHAR)ch >= 32 && (charcount != (maxlen - 2))) #endif /* _UNICODE */ { /* insert character into string... */ @@ -525,8 +520,6 @@ /* If this character insertion will cause screen scrolling, * adjust the saved origin of the command prompt. */ tempscreen = _tcslen(str + current) + curx; - str = realloc(str, tempscreen * sizeof(TCHAR)); - if ((tempscreen % maxx) == (maxx - 1) && (tempscreen / maxx) + cury == (maxy - 1)) { @@ -534,8 +527,6 @@ cury--; }
- - for (count = charcount; count > current; count--) str[count] = str[count - 1]; str[current++] = ch; @@ -579,6 +570,4 @@ while (ir.Event.KeyEvent.wVirtualKeyCode != VK_RETURN);
SetCursorType (bInsert, TRUE); - - return str; }