cleanup
authorEric Kohl <eric.kohl@reactos.org>
Wed, 19 May 1999 18:00:17 +0000 (18:00 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Wed, 19 May 1999 18:00:17 +0000 (18:00 +0000)
svn path=/trunk/; revision=490

reactos/apps/utils/cmd/type.c
reactos/lib/kernel32/file/delete.c

index 8d772dd..c7bc992 100644 (file)
@@ -63,10 +63,13 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
                return 1;
        }
 
-       hFile = CreateFile (arg[0], GENERIC_READ, FILE_SHARE_READ,
-                                               NULL, OPEN_EXISTING,
-                                               FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
-                                               NULL);
+        hFile = CreateFile (arg[0],
+                            GENERIC_READ,
+                            FILE_SHARE_READ,
+                            NULL,
+                            OPEN_EXISTING,
+                            FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
+                            NULL);
 
        if (hFile == INVALID_HANDLE_VALUE)
        {
@@ -77,11 +80,17 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
 
        do
        {
-               bResult = ReadFile (hFile, szBuffer, sizeof(szBuffer),
-                                                       &dwBytesRead, NULL);
+                bResult = ReadFile (hFile,
+                                    szBuffer,
+                                    sizeof(szBuffer),
+                                    &dwBytesRead,
+                                    NULL);
                if (dwBytesRead)
-                       WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szBuffer, dwBytesRead,
-                                          &dwBytesWritten, NULL);
+                        WriteFile (GetStdHandle (STD_OUTPUT_HANDLE),
+                                   szBuffer,
+                                   dwBytesRead,
+                                   &dwBytesWritten,
+                                   NULL);
        }
        while (bResult && dwBytesRead > 0);
 
index de0ac6d..4ea374d 100644 (file)
@@ -1,16 +1,13 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/kernel32/file/file.c
- * PURPOSE:         Directory functions
+ * FILE:            lib/kernel32/file/delete.c
+ * PURPOSE:         Deleting files
  * PROGRAMMER:      Ariadne ( ariadne@xs4all.nl)
- *                 GetTempFileName is modified from WINE [ Alexandre Juiliard ]
  * UPDATE HISTORY:
  *                  Created 01/11/98
  */
 
-/* FIXME: the large integer manipulations in this file dont handle overflow  */
-
 /* INCLUDES ****************************************************************/
 
 #include <windows.h>
@@ -27,7 +24,7 @@ WINBOOL STDCALL DeleteFileA(LPCSTR lpFileName)
 {
    ULONG i;
    WCHAR FileNameW[MAX_PATH];
-   
+
    i = 0;
    while ((*lpFileName)!=0 && i < MAX_PATH)
      {
@@ -46,7 +43,7 @@ WINBOOL STDCALL DeleteFileW(LPCWSTR lpFileName)
    NTSTATUS errCode;
    WCHAR PathNameW[MAX_PATH];
    UINT Len;
-       
+
    if (lpFileName[1] != ':') 
      {
        Len =  GetCurrentDirectoryW(MAX_PATH,PathNameW);
@@ -64,13 +61,13 @@ WINBOOL STDCALL DeleteFileW(LPCWSTR lpFileName)
    FileNameString.Length = lstrlenW( PathNameW)*sizeof(WCHAR);
    if ( FileNameString.Length == 0 )
      return FALSE;
-   
+
    if (FileNameString.Length > MAX_PATH*sizeof(WCHAR))
      return FALSE;
-   
+
    FileNameString.Buffer = (WCHAR *)PathNameW;
    FileNameString.MaximumLength = FileNameString.Length+sizeof(WCHAR);
-  
+
    ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
    ObjectAttributes.RootDirectory = NULL;
    ObjectAttributes.ObjectName = &FileNameString;
@@ -86,4 +83,3 @@ WINBOOL STDCALL DeleteFileW(LPCWSTR lpFileName)
      }
    return TRUE;
 }
-