fix errors in "activate". Change activate, window, and msgbox commands from checking for __REACTOS__ to NT4_INTERNAL_COMMAND. they are turned off by default(uncomment line 23 to enable). Modified: trunk/reactos/subsys/system/cmd/config.h Modified: trunk/reactos/subsys/system/cmd/window.c _____
Modified: trunk/reactos/subsys/system/cmd/config.h --- trunk/reactos/subsys/system/cmd/config.h 2005-10-18 12:25:31 UTC (rev 18551) +++ trunk/reactos/subsys/system/cmd/config.h 2005-10-18 13:32:32 UTC (rev 18552) @@ -20,6 +20,8 @@
#define WIN32_LEAN_AND_MEAN
+//#define NT4_INTERNAL_COMMANDS + /* Define to enable the alias command, and aliases.*/ #define FEATURE_ALIASES
@@ -51,7 +53,7 @@ /* #define LOCALE_GERMAN */ /* German locale */ /* #define LOCALE_DEFAULT */ /* United States locale */
-#ifndef __REACTOS__ +#ifdef NT4_INTERNAL_COMMANDS #define INCLUDE_CMD_ACTIVATE #endif #define INCLUDE_CMD_ATTRIB @@ -70,7 +72,7 @@ #define INCLUDE_CMD_MEMORY #define INCLUDE_CMD_MKDIR #define INCLUDE_CMD_MOVE -#ifndef __REACTOS__ +#ifdef NT4_INTERNAL_COMMANDS #define INCLUDE_CMD_MSGBOX #endif #define INCLUDE_CMD_PATH @@ -90,7 +92,7 @@ #define INCLUDE_CMD_BEEP #define INCLUDE_CMD_VERIFY #define INCLUDE_CMD_VOL -#ifndef __REACTOS__ +#ifdef NT4_INTERNAL_COMMANDS #define INCLUDE_CMD_WINDOW #endif
_____
Modified: trunk/reactos/subsys/system/cmd/window.c --- trunk/reactos/subsys/system/cmd/window.c 2005-10-18 12:25:31 UTC (rev 18551) +++ trunk/reactos/subsys/system/cmd/window.c 2005-10-18 13:32:32 UTC (rev 18552) @@ -49,9 +49,8 @@
if (*param) - p = split(param, &argc); + p = split(param, &argc, FALSE);
- for (i = 0; i < argc; i++) { p_tmp = p[i]; @@ -187,7 +186,7 @@ return 0; }
- h = GetConsoleWindow(); + hwnd = GetConsoleWindow(); Sleep(0); return ServiceActivate(param, hwnd); } @@ -195,8 +194,9 @@
INT CommandActivate (LPTSTR cmd, LPTSTR param) { - LPTSTR str; HWND hwnd; + LPTSTR *arg; + INT argc;
if (_tcsncmp (param, _T("/?"), 2) == 0) { @@ -207,24 +207,25 @@ if(!(*param)) return 1;
- str=_tcschr(param,_T(' ')); - - if (str) + /*Split the user input into array*/ + arg = split (param, &argc, FALSE); + if(argc < 2) { - *str=_T('\0'); - str++; + if(arg != NULL) + freep(arg); } - else - str = ""; - - hwnd = FindWindow(NULL, param); + hwnd = FindWindow(NULL, arg[0]); if (hwnd == NULL) { + if(arg != NULL) + freep(arg); ConErrResPuts(STRING_WINDOW_ERROR1); return 1; } + if(arg != NULL) + freep(arg);
- return ServiceActivate(str, hwnd); + return ServiceActivate(param, hwnd); }
#endif /* ( defined(INCLUDE_CMD_WINDOW) || defined(INCLUDE_CMD_ACTIVATE) ) */