From 2e307cf29ef42a47db416dd2a468baa18a86f3a3 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Fri, 15 Jul 2005 13:51:38 +0000 Subject: [PATCH] Add environment variable COPYCMD to copy svn path=/trunk/; revision=16574 --- reactos/subsys/system/cmd/copy.c | 88 ++++++++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 3 deletions(-) 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