changes to make cmd compile (not link)
[reactos.git] / reactos / apps / utils / cmd / set.c
index 7be3388..a1c9dc7 100644 (file)
  *    24-Jan-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
  *        Fixed Win32 environment handling.
  *        Unicode and redirection safe!
+ *
+ *    25-Feb-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
+ *        Fixed little bug.
  */
 
-#define WIN32_LEAN_AND_MEAN
-
 #include "config.h"
 
 #ifdef INCLUDE_CMD_SET
@@ -42,7 +43,7 @@
 #include "cmd.h"
 
 
-/* size of environment variable buffer */
+/* initial size of environment variable buffer */
 #define ENV_BUFFER_SIZE  1024
 
 
@@ -81,7 +82,7 @@ INT cmd_set (LPTSTR cmd, LPTSTR param)
                                        lpOutput += (len + 1);
                                }
                        }
-                   FreeEnvironmentStrings (lpEnv);
+                       FreeEnvironmentStrings (lpEnv);
                }
 
                return 0;
@@ -112,7 +113,7 @@ INT cmd_set (LPTSTR cmd, LPTSTR param)
                else if (dwBuffer > ENV_BUFFER_SIZE)
                {
                        pszBuffer = (LPTSTR)realloc (pszBuffer, dwBuffer * sizeof (TCHAR));
-                       GetEnvironmentVariable (param, pszBuffer, ENV_BUFFER_SIZE);
+                       GetEnvironmentVariable (param, pszBuffer, dwBuffer * sizeof (TCHAR));
                }
 
                ConOutPrintf ("%s\n", pszBuffer);