Fix whitespace (part 2/x) (convert tabs into 4-space indent).

svn path=/trunk/; revision=59378
This commit is contained in:
Hermès Bélusca-Maïto 2013-06-29 23:50:13 +00:00
parent b067add889
commit 9b6dc5bd15
21 changed files with 2581 additions and 2573 deletions

View file

@ -1,7 +1,5 @@
/* /*
* BATCH.H - A structure to preserve the context of a batch file * BATCH.H - A structure to preserve the context of a batch file
*
*
*/ */
#pragma once #pragma once
@ -32,7 +30,8 @@ typedef struct tagFORCONTEXT
} FOR_CONTEXT, *LPFOR_CONTEXT; } FOR_CONTEXT, *LPFOR_CONTEXT;
/* The stack of current batch contexts. /*
* The stack of current batch contexts.
* NULL when no batch is active * NULL when no batch is active
*/ */
extern LPBATCH_CONTEXT bc; extern LPBATCH_CONTEXT bc;

View file

@ -43,8 +43,8 @@
* 24-Jan-1999 (Eric Kohl) * 24-Jan-1999 (Eric Kohl)
* Fixed Win32 environment handling. * Fixed Win32 environment handling.
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
*/ */
#include "precomp.h" #include "precomp.h"
@ -198,13 +198,15 @@ INT cmd_prompt (LPTSTR param)
return 0; return 0;
} }
/* if it is null, then it needs to set to default, /*
because that means the user entered "prompt" only. * if it is null, then it needs to set to default,
so even if param is null you _must_ still set prompt * because that means the user entered "prompt" only.
to the default. There seems to be some kinda difference * so even if param is null you _must_ still set prompt
between winxp and 2k in this matter and this way will * to the default. There seems to be some kinda difference
cover both. Do not use fixed size of szParam for param the buffer are 8192bytes * between winxp and 2k in this matter and this way will
and will later change to dymatic buffer */ * cover both. Do not use fixed size of szParam for param the buffer
* are 8192 bytes and will later change to dymatic buffer.
*/
/* set PROMPT environment variable */ /* set PROMPT environment variable */
if (param[0] != _T('\0')) if (param[0] != _T('\0'))
@ -220,8 +222,6 @@ INT cmd_prompt (LPTSTR param)
return 1; return 1;
} }
return 0; return 0;
} }
#endif #endif

View file

@ -17,8 +17,9 @@
* 17-Oct-2001 (Eric Kohl) * 17-Oct-2001 (Eric Kohl)
* Implemented basic rename code. * Implemented basic rename code.
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
*
* 25-Nov-2008 (Victor Martinez) <vicmarcal@hotmail.com> Patch dedicated to Myrjala because her comprenhension and love :D * 25-Nov-2008 (Victor Martinez) <vicmarcal@hotmail.com> Patch dedicated to Myrjala because her comprenhension and love :D
* Fixing following Bugs: * Fixing following Bugs:
* -Wrong behavior with wildcards when Source and Destiny are Paths(FIXED). * -Wrong behavior with wildcards when Source and Destiny are Paths(FIXED).
@ -47,7 +48,6 @@ enum
/* /*
* file rename internal command. * file rename internal command.
*
*/ */
INT cmd_rename (LPTSTR param) INT cmd_rename (LPTSTR param)
{ {
@ -59,13 +59,11 @@ INT cmd_rename (LPTSTR param)
DWORD dwFiles = 0; /* number of renamedd files */ DWORD dwFiles = 0; /* number of renamedd files */
INT i; INT i;
LPTSTR srcPattern = NULL; /* Source Argument*/ LPTSTR srcPattern = NULL; /* Source Argument*/
TCHAR srcPath[MAX_PATH]; /*Source Path Directories*/ TCHAR srcPath[MAX_PATH]; /*Source Path Directories*/
LPTSTR srcFILE = NULL; /*Contains the files name(s)*/ LPTSTR srcFILE = NULL; /*Contains the files name(s)*/
TCHAR srcFinal[MAX_PATH]; TCHAR srcFinal[MAX_PATH];
LPTSTR dstPattern = NULL; /*Destiny Argument*/ LPTSTR dstPattern = NULL; /*Destiny Argument*/
TCHAR dstPath[MAX_PATH]; /*Source Path Directories*/ TCHAR dstPath[MAX_PATH]; /*Source Path Directories*/
LPTSTR dstFILE = NULL; /*Contains the files name(s)*/ LPTSTR dstFILE = NULL; /*Contains the files name(s)*/
@ -76,11 +74,6 @@ INT cmd_rename (LPTSTR param)
BOOL bDstWildcard = FALSE; BOOL bDstWildcard = FALSE;
BOOL bPath = FALSE; BOOL bPath = FALSE;
LPTSTR p,q,r; LPTSTR p,q,r;
HANDLE hFile; HANDLE hFile;
@ -88,8 +81,6 @@ INT cmd_rename (LPTSTR param)
/*If the PARAM=/? then show the help*/ /*If the PARAM=/? then show the help*/
if (!_tcsncmp(param, _T("/?"), 2)) if (!_tcsncmp(param, _T("/?"), 2))
{ {
ConOutResPaging(TRUE,STRING_REN_HELP1); ConOutResPaging(TRUE,STRING_REN_HELP1);
return 0; return 0;
} }

View file

@ -71,21 +71,29 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d
return 0; return 0;
} }
/* Get the time from source file to be used in the comparison with /*
dest time if update switch is set */ * Get the time from source file to be used in the comparison
* with dest time if update switch is set.
*/
GetFileTime (hFileSrc, &srcCreationTime, &srcLastAccessTime, &srcLastWriteTime); GetFileTime (hFileSrc, &srcCreationTime, &srcLastAccessTime, &srcLastWriteTime);
/* Retrieve the source attributes so that they later on can be /*
inserted in to the destination */ * Retrieve the source attributes so that they later on
* can be inserted in to the destination.
*/
dwAttrib = GetFileAttributes (source); dwAttrib = GetFileAttributes (source);
if(IsExistingFile (dest)) if(IsExistingFile (dest))
{ {
/* Resets the attributes to avoid probles with read only files, /*
checks for read only has been made earlier */ * Resets the attributes to avoid probles with read only files,
* checks for read only has been made earlier.
*/
SetFileAttributes(dest,FILE_ATTRIBUTE_NORMAL); SetFileAttributes(dest,FILE_ATTRIBUTE_NORMAL);
/* Is the update flas set? The time has to be controled so that /*
only older files are replaced */ * Is the update flas set? The time has to be controled so that
* only older files are replaced.
*/
if(dwFlags & REPLACE_UPDATE) if(dwFlags & REPLACE_UPDATE)
{ {
/* Read destination time */ /* Read destination time */
@ -200,7 +208,10 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d
/* Function to iterate over source files and call replace for each of them */ /* Function to iterate over source files and call replace for each of them */
INT recReplace(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PATH], BOOL *doMore) INT recReplace(DWORD dwFlags,
TCHAR szSrcPath[MAX_PATH],
TCHAR szDestPath[MAX_PATH],
BOOL *doMore)
{ {
TCHAR tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH]; TCHAR tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH];
INT filesReplaced=0; INT filesReplaced=0;
@ -212,13 +223,17 @@ INT recReplace(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PA
/* Get file handel to the sourcefile(s) */ /* Get file handel to the sourcefile(s) */
hFile = FindFirstFile (szSrcPath, &findBuffer); hFile = FindFirstFile (szSrcPath, &findBuffer);
/* Strip the paths back to the folder they are in, so that the diffrent /*
filenames can be added if more than one */ * Strip the paths back to the folder they are in, so that
* the different filenames can be added if more than one.
*/
for(i = (_tcslen(szSrcPath) - 1); i > -1; i--) for(i = (_tcslen(szSrcPath) - 1); i > -1; i--)
{
if(szSrcPath[i] != _T('\\')) if(szSrcPath[i] != _T('\\'))
szSrcPath[i] = _T('\0'); szSrcPath[i] = _T('\0');
else else
break; break;
}
/* Go through all the soursfiles and copy/replace them */ /* Go through all the soursfiles and copy/replace them */
do do
@ -302,8 +317,10 @@ INT recFindSubDirs(DWORD dwFlags,
INT filesReplaced = 0; INT filesReplaced = 0;
INT_PTR i; INT_PTR i;
/* Add a wildcard to dest end so the it will be easy to itterate /*
over all the files and directorys in the dest directory */ * Add a wildcard to dest end so the it will be easy to iterate
* over all the files and directorys in the dest directory.
*/
_tcscat(szDestPath, _T("*")); _tcscat(szDestPath, _T("*"));
/* Get the first file in the directory */ /* Get the first file in the directory */
@ -311,10 +328,12 @@ INT recFindSubDirs(DWORD dwFlags,
/* Remove the star added earlyer to dest path */ /* Remove the star added earlyer to dest path */
for(i = (_tcslen(szDestPath) - 1); i > -1; i--) for(i = (_tcslen(szDestPath) - 1); i > -1; i--)
{
if(szDestPath[i] != _T('\\')) if(szDestPath[i] != _T('\\'))
szDestPath[i] = _T('\0'); szDestPath[i] = _T('\0');
else else
break; break;
}
/* Iterate over all filed directories in the dest dir */ /* Iterate over all filed directories in the dest dir */
do do
@ -328,8 +347,10 @@ INT recFindSubDirs(DWORD dwFlags,
return filesReplaced; return filesReplaced;
} }
/* Check if the we should enter the dir or if it is a file /*
or . or .. if so thake the next object to process */ * Check if the we should enter the dir or if it is a file
* or . or .. if so thake the next object to process.
*/
if(!_tcscmp (findBuffer.cFileName, _T(".")) || if(!_tcscmp (findBuffer.cFileName, _T(".")) ||
!_tcscmp (findBuffer.cFileName, _T(".."))|| !_tcscmp (findBuffer.cFileName, _T(".."))||
IsExistingFile(findBuffer.cFileName)) IsExistingFile(findBuffer.cFileName))

View file

@ -6,8 +6,8 @@
* 30 Aug 1999 * 30 Aug 1999
* started - Paolo Pantaleo <paolopan@freemail.it> * started - Paolo Pantaleo <paolopan@freemail.it>
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
* *
*/ */

View file

@ -30,8 +30,8 @@
* 25-Feb-1999 (Eric Kohl) * 25-Feb-1999 (Eric Kohl)
* Fixed little bug. * Fixed little bug.
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
*/ */
#include "precomp.h" #include "precomp.h"

View file

@ -9,7 +9,8 @@
#include "precomp.h" #include "precomp.h"
typedef struct _SETLOCAL { typedef struct _SETLOCAL
{
struct _SETLOCAL *Prev; struct _SETLOCAL *Prev;
BOOL DelayedExpansion; BOOL DelayedExpansion;
LPTSTR Environment; LPTSTR Environment;
@ -21,13 +22,15 @@ DuplicateEnvironment(VOID)
{ {
LPTSTR Environ = GetEnvironmentStrings(); LPTSTR Environ = GetEnvironmentStrings();
LPTSTR End, EnvironCopy; LPTSTR End, EnvironCopy;
if (!Environ)
return NULL; if (!Environ) return NULL;
for (End = Environ; *End; End += _tcslen(End) + 1)
; for (End = Environ; *End; End += _tcslen(End) + 1) ;
EnvironCopy = cmd_alloc((End + 1 - Environ) * sizeof(TCHAR)); EnvironCopy = cmd_alloc((End + 1 - Environ) * sizeof(TCHAR));
if (EnvironCopy) if (EnvironCopy)
memcpy(EnvironCopy, Environ, (End + 1 - Environ) * sizeof(TCHAR)); memcpy(EnvironCopy, Environ, (End + 1 - Environ) * sizeof(TCHAR));
FreeEnvironmentStrings(Environ); FreeEnvironmentStrings(Environ);
return EnvironCopy; return EnvironCopy;
} }

View file

@ -19,8 +19,8 @@
* 20-Jan-1999 (Eric Kohl) * 20-Jan-1999 (Eric Kohl)
* Unicode and redirection safe! * Unicode and redirection safe!
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
*/ */
#include "precomp.h" #include "precomp.h"

View file

@ -7,8 +7,8 @@
* 24-Jul-1999 (Eric Kohl) * 24-Jul-1999 (Eric Kohl)
* Started. * Started.
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
*/ */
#include "precomp.h" #include "precomp.h"
@ -313,7 +313,6 @@ INT cmd_start (LPTSTR Rest)
_T("Error executing CreateProcess()!!\n")); _T("Error executing CreateProcess()!!\n"));
} }
cmd_free(comspec); cmd_free(comspec);
return 0; return 0;
} }

View file

@ -7,7 +7,6 @@
* 07-Oct-1999 (Paolo Pantaleo) * 07-Oct-1999 (Paolo Pantaleo)
* Started. * Started.
* *
*
*/ */
/* /*

View file

@ -20,8 +20,8 @@
* 04-Feb-1999 (Eric Kohl) * 04-Feb-1999 (Eric Kohl)
* Fixed time input bug. * Fixed time input bug.
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc. * Remove all hardcoded strings in En.rc.
*/ */
#include "precomp.h" #include "precomp.h"

View file

@ -5,8 +5,8 @@
* History: * History:
* 1999-02-11 Emanuele Aliberti * 1999-02-11 Emanuele Aliberti
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
*/ */
#include "precomp.h" #include "precomp.h"
@ -16,7 +16,6 @@
INT cmd_title (LPTSTR param) INT cmd_title (LPTSTR param)
{ {
/* Do nothing if no args */ /* Do nothing if no args */
if (*param == _T('\0')) if (*param == _T('\0'))
return 0; return 0;

View file

@ -22,8 +22,8 @@
* 19-Jan-1999 (Paolo Pantaleo <paolopan@freemail.it>) * 19-Jan-1999 (Paolo Pantaleo <paolopan@freemail.it>)
* Added multiple file support (copied from y.c) * Added multiple file support (copied from y.c)
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
*/ */
#include "precomp.h" #include "precomp.h"

View file

@ -54,8 +54,6 @@ VOID ShortVersion (VOID)
/* /*
* display shell version info internal command. * display shell version info internal command.
*
*
*/ */
INT cmd_ver (LPTSTR param) INT cmd_ver (LPTSTR param)
{ {
@ -74,7 +72,6 @@ INT cmd_ver (LPTSTR param)
/* Basic copyright notice */ /* Basic copyright notice */
if (param[0] != _T('\0')) if (param[0] != _T('\0'))
{ {
ConOutPuts (_T("Copyright (C) 1994-1998 Tim Norman and others.")); ConOutPuts (_T("Copyright (C) 1994-1998 Tim Norman and others."));
ConOutPuts (_T("Copyright (C) 1998-") _T(COPYRIGHT_YEAR) _T(" ReactOS Team")); ConOutPuts (_T("Copyright (C) 1998-") _T(COPYRIGHT_YEAR) _T(" ReactOS Team"));

View file

@ -14,8 +14,8 @@
* 20-Jan-1999 (Eric Kohl) * 20-Jan-1999 (Eric Kohl)
* Unicode and redirection ready! * Unicode and redirection ready!
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
*/ */
#include "precomp.h" #include "precomp.h"

View file

@ -83,7 +83,9 @@ INT cmd_vol (LPTSTR param)
{ {
_tcsupr (param); _tcsupr (param);
if (param[1] == _T(':')) if (param[1] == _T(':'))
{
szRootPath[0] = param[0]; szRootPath[0] = param[0];
}
else else
{ {
error_invalid_drive (); error_invalid_drive ();

View file

@ -69,7 +69,7 @@
* Some minor changes and improvements. * Some minor changes and improvements.
* *
* 10-Jul-2004 (Jens Collin <jens.collin@lakhei.com>) * 10-Jul-2004 (Jens Collin <jens.collin@lakhei.com>)
* Fixed searxhing for files with specific extensions in PATHEXT order.. * Fixed searching for files with specific extensions in PATHEXT order.
* *
*/ */

View file

@ -10,14 +10,14 @@
* activate and window in a single file using mainly the same code * activate and window in a single file using mainly the same code
* (nice size optimization :) * (nice size optimization :)
* *
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>) * 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>
* Remove all hardcode string to En.rc * Remove all hardcoded strings in En.rc
*/ */
#include "precomp.h" #include "precomp.h"
#if ( defined(INCLUDE_CMD_WINDOW) || defined(INCLUDE_CMD_ACTIVATE) ) #if defined(INCLUDE_CMD_WINDOW) || defined(INCLUDE_CMD_ACTIVATE)
#define A_MIN 0x01 #define A_MIN 0x01
@ -28,13 +28,12 @@
#define A_CLOSE 0x20 #define A_CLOSE 0x20
/*service funciton to perform actions on windows /*
* service function to perform actions on windows
param is a string to parse for options/actions *
hWnd is the handle of window on wich perform actions * param is a string to parse for options/actions
* hWnd is the handle of window on which to perform actions
*/ */
static INT ServiceActivate (LPTSTR param, HWND hWnd) static INT ServiceActivate (LPTSTR param, HWND hWnd)
{ {
LPTSTR *p = 0, p_tmp; LPTSTR *p = 0, p_tmp;
@ -45,7 +44,6 @@ static INT ServiceActivate (LPTSTR param, HWND hWnd)
RECT pos; RECT pos;
LPTSTR tmp; LPTSTR tmp;
if (*param) if (*param)
p = split(param, &argc, FALSE); p = split(param, &argc, FALSE);
@ -224,4 +222,4 @@ INT CommandActivate (LPTSTR param)
return ServiceActivate(param, hwnd); return ServiceActivate(param, hwnd);
} }
#endif /* ( defined(INCLUDE_CMD_WINDOW) || defined(INCLUDE_CMD_ACTIVATE) ) */ #endif /* defined(INCLUDE_CMD_WINDOW) || defined(INCLUDE_CMD_ACTIVATE) */