diff --git a/reactos/subsys/system/cmd/copy.c b/reactos/subsys/system/cmd/copy.c index 10c4980f501..cde309755c4 100644 --- a/reactos/subsys/system/cmd/copy.c +++ b/reactos/subsys/system/cmd/copy.c @@ -254,18 +254,100 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) TCHAR * UseThisName; /* Stores the name( i.e. blah.txt or blah*.txt) which later we might need */ TCHAR PreserveName[MAX_PATH]; + /* for CMDCOPY env */ + TCHAR *evar; + int size; - /*Show help/usage info*/ + + /*Show help/usage info*/ if (!_tcsncmp (param, _T("/?"), 2)) { ConOutResPaging(TRUE, STRING_COPY_HELP2); return 0; } - /*Split the user input into array*/ + /* Get the envor value if it exists */ + evar = malloc(512); + size = GetEnvironmentVariable (_T("COPYCMD"), evar, 512); + if (size > 512) + { + evar = realloc(evar,size * sizeof(TCHAR) ); + if (evar!=NULL) + { + size = GetEnvironmentVariable (_T("COPYCMD"), evar, size); + } + } + /* check see if we did get any env variable */ + if (size !=0) + { + int t=0; + /* scan and set the flags */ + for (t=0;t