--- trunk/reactos/subsys/system/cmd/copy.c 2005-07-15 17:46:26 UTC (rev 16585)
+++ trunk/reactos/subsys/system/cmd/copy.c 2005-07-15 18:18:40 UTC (rev 16586)
@@ -275,15 +275,22 @@
/* Get the envor value if it exists */
evar = malloc(512);
- size = GetEnvironmentVariable (_T("COPYCMD"), evar, 512);
- if (size > 512)
+ if (evar==NULL) size = 0;
+
+ size = GetEnvironmentVariable (_T("COPYCMD"), evar, 512);
+ if ((size > 1) && (size > 512))
{
evar = realloc(evar,size * sizeof(TCHAR) );
if (evar!=NULL)
{
size = GetEnvironmentVariable (_T("COPYCMD"), evar, size);
}
+ else
+ {
+ size=0;
+ }
}
+
/* check see if we did get any env variable */
if (size !=0)
{