WCMD_ATTRIB separated from builtins.c and moved into its own file

EG Galano eg.galano at gmail.com
Wed Mar 31 05:54:40 CDT 2010


---
 programs/cmd/builtins.c |   83 -----------------------------------------------
 programs/cmd/wcmd.h     |    1 -
 programs/cmd/wcmdmain.c |    3 --
 3 files changed, 0 insertions(+), 87 deletions(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 8049ed8..f2bf216 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -1791,89 +1791,6 @@ void WCMD_endlocal (void) {
 }
 
 /*****************************************************************************
- * WCMD_setshow_attrib
- *
- * Display and optionally sets DOS attributes on a file or directory
- *
- */
-
-void WCMD_setshow_attrib (void) {
-
-  DWORD count;
-  HANDLE hff;
-  WIN32_FIND_DATAW fd;
-  WCHAR flags[9] = {' ',' ',' ',' ',' ',' ',' ',' ','\0'};
-  WCHAR *name = param1;
-  DWORD attrib_set=0;
-  DWORD attrib_clear=0;
-
-  if (param1[0] == '+' || param1[0] == '-') {
-    DWORD attrib = 0;
-    /* FIXME: the real cmd can handle many more than two args; this should be in a loop */
-    switch (param1[1]) {
-    case 'H': case 'h': attrib |= FILE_ATTRIBUTE_HIDDEN; break;
-    case 'S': case 's': attrib |= FILE_ATTRIBUTE_SYSTEM; break;
-    case 'R': case 'r': attrib |= FILE_ATTRIBUTE_READONLY; break;
-    case 'A': case 'a': attrib |= FILE_ATTRIBUTE_ARCHIVE; break;
-    default:
-      WCMD_output (WCMD_LoadMessage(WCMD_NYI));
-      return;
-    }
-    switch (param1[0]) {
-    case '+': attrib_set = attrib; break;
-    case '-': attrib_clear = attrib; break;
-    }
-    name = param2;
-  }
-
-  if (strlenW(name) == 0) {
-    static const WCHAR slashStarW[]  = {'\\','*','\0'};
-
-    GetCurrentDirectoryW(sizeof(param2)/sizeof(WCHAR), name);
-    strcatW (name, slashStarW);
-  }
-
-  hff = FindFirstFileW(name, &fd);
-  if (hff == INVALID_HANDLE_VALUE) {
-    WCMD_output (WCMD_LoadMessage(WCMD_FILENOTFOUND), name);
-  }
-  else {
-    do {
-      if (attrib_set || attrib_clear) {
-        fd.dwFileAttributes &= ~attrib_clear;
-        fd.dwFileAttributes |= attrib_set;
-        if (!fd.dwFileAttributes)
-           fd.dwFileAttributes |= FILE_ATTRIBUTE_NORMAL;
-        SetFileAttributesW(name, fd.dwFileAttributes);
-      } else {
-        static const WCHAR fmt[] = {'%','s',' ',' ',' ','%','s','\n','\0'};
-        if (fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) {
-	  flags[0] = 'H';
-	}
-        if (fd.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) {
-	  flags[1] = 'S';
-	}
-        if (fd.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE) {
-	  flags[2] = 'A';
-	}
-        if (fd.dwFileAttributes & FILE_ATTRIBUTE_READONLY) {
-	  flags[3] = 'R';
-	}
-        if (fd.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY) {
-	  flags[4] = 'T';
-	}
-        if (fd.dwFileAttributes & FILE_ATTRIBUTE_COMPRESSED) {
-	  flags[5] = 'C';
-	}
-        WCMD_output (fmt, flags, fd.cFileName);
-	for (count=0; count < 8; count++) flags[count] = ' ';
-      }
-    } while (FindNextFileW(hff, &fd) != 0);
-  }
-  FindClose (hff);
-}
-
-/*****************************************************************************
  * WCMD_setshow_default
  *
  *	Set/Show the current default directory
diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h
index 2fde678..e5d7d79 100644
--- a/programs/cmd/wcmd.h
+++ b/programs/cmd/wcmd.h
@@ -80,7 +80,6 @@ void WCMD_remove_dir (WCHAR *command);
 void WCMD_rename (void);
 void WCMD_run_program (WCHAR *command, int called);
 void WCMD_setlocal (const WCHAR *command);
-void WCMD_setshow_attrib (void);
 void WCMD_setshow_date (void);
 void WCMD_setshow_default (WCHAR *command);
 void WCMD_setshow_env (WCHAR *command);
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index b86801c..2832374 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1422,9 +1422,6 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
 
     switch (i) {
 
-      case WCMD_ATTRIB:
-        WCMD_setshow_attrib ();
-        break;
       case WCMD_CALL:
         WCMD_call (p);
         break;
-- 
1.6.3.3


--=-m2/cE5Gy7wW7KYGSUfht--




More information about the wine-patches mailing list