[FORMATTING] Remove trailing whitespace. Addendum to 34593d93.

Excluded: 3rd-party code (incl. wine) and most of the win32ss.
This commit is contained in:
Hermès Bélusca-Maïto 2021-09-13 03:33:14 +02:00
parent bbabe2489e
commit 9393fc320e
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
701 changed files with 14685 additions and 14693 deletions

View file

@ -29,7 +29,7 @@ typedef struct _BATCH_CONTEXT
char *mem; /* batchfile content in memory */
DWORD memsize; /* size of batchfile */
DWORD mempos; /* current position to read from */
BOOL memfree; /* true if it need to be freed when exitbatch is called */
BOOL memfree; /* true if it need to be freed when exitbatch is called */
TCHAR BatchFilePath[MAX_PATH];
LPTSTR params;
LPTSTR raw_params; /* Holds the raw params given by the input */

View file

@ -74,7 +74,7 @@ CheckTerminalDeviceType(IN LPCTSTR pszName)
}
else
if ( _wcsnicmp(DeviceName, DosLPTDevice, 3) == 0 ||
_wcsnicmp(DeviceName, DosCOMDevice, 3) == 0 ||
_wcsnicmp(DeviceName, DosCOMDevice, 3) == 0 ||
_wcsnicmp(DeviceName, DosPRNDevice, 3) == 0 ||
_wcsnicmp(DeviceName, DosAUXDevice, 3) == 0 ||
_wcsnicmp(DeviceName, DosNULDevice, 3) == 0 )

View file

@ -1,32 +1,32 @@
General Overview of How Things Work
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
First it comes into _main in cmd.c(1811). The command line params are taking in and if it is unicode it uses CommandLineToArgvW.
This can cause a problem on older machines and that is why we have our own custom _CommandLineToArgvW to help this along.
We pull in the launch directory as the initial dir and set that in _tchdir. We make a handle to the default console out using CreateFile.
First it comes into _main in cmd.c(1811). The command line params are taking in and if it is unicode it uses CommandLineToArgvW.
This can cause a problem on older machines and that is why we have our own custom _CommandLineToArgvW to help this along.
We pull in the launch directory as the initial dir and set that in _tchdir. We make a handle to the default console out using CreateFile.
Then we call Initialize(). Here we need to load ntdll.dll if it isn't loaded (windows 9x machines).
We also setup some global vars like default io handles and nErrorLevel and set %prompt% to $P$G.
Then we call Initialize(). Here we need to load ntdll.dll if it isn't loaded (windows 9x machines).
We also setup some global vars like default io handles and nErrorLevel and set %prompt% to $P$G.
This is where all command lines switches given to cmd on startup are done.
From here main calls ProcessInput(). This is where cmd loops for getting input and doing the commands.
First it checks to see if there is a batch file(note: there is a global struct "bc" which is NULL when not processing a batch file)
and if there is it will pull a new line from that file. If not, then it will wait for input.
Currently there is some stuff for set /a in there, which might stay there or see if we can find a better spot.
From here main calls ProcessInput(). This is where cmd loops for getting input and doing the commands.
First it checks to see if there is a batch file(note: there is a global struct "bc" which is NULL when not processing a batch file)
and if there is it will pull a new line from that file. If not, then it will wait for input.
Currently there is some stuff for set /a in there, which might stay there or see if we can find a better spot.
Once there is input taken in from the command line it is sent into ParseCommandLine().
In here we fist check for aliases and convert if need be.
Then we look for redirections using GetRedirection() which will remove any redirection symbols.
and pass back info about where to redirect.
from this info it will do some switching around with the handles for where things go and send them as need be.
personally i dont like this code and i tried to change it before but failed.
Once there is input taken in from the command line it is sent into ParseCommandLine().
In here we fist check for aliases and convert if need be.
Then we look for redirections using GetRedirection() which will remove any redirection symbols.
and pass back info about where to redirect.
from this info it will do some switching around with the handles for where things go and send them as need be.
personally i dont like this code and i tried to change it before but failed.
it is confusing to me and i dont understand why a lot of it is there but apparently it is needed.
It sends the new string without any redirection info into DoCommand(). In this function we just look to see what should be done.
There is one of 2 things that could happen.
1) we fnd the matching command and send it off to that commands little section.
It sends the new string without any redirection info into DoCommand(). In this function we just look to see what should be done.
There is one of 2 things that could happen.
1) we fnd the matching command and send it off to that commands little section.
2) we dont find it so we send it to Execute() and see if it is a file that we can do something.
Execute will try to launch the file using createprocess and falls back on shellexecute.
Execute will try to launch the file using createprocess and falls back on shellexecute.
It calls a function called SearchForExecutable() to find the full path name and looks in all the correct locations like PATH,
current folder, windows folder. If it cant find it, just fails and prints out a message.

View file

@ -1,6 +1,6 @@
Made by Vicmarcal 23/11/08
THIS FILE HELPS TO EXPLAIN HOW REN IS NOW IMPLEMENTED.
THIS FILE HELPS TO EXPLAIN HOW REN IS NOW IMPLEMENTED.
****************************************************************
(Please change or add latest modifications)
****************************************************************
@ -14,7 +14,7 @@ ren c:\ie\hello.txt c:\ie\hi.txt
rename command will change the name of hello.txt->hi.txt. We have to be sure that both paths(c:\ie\ ) be the same.Since rename cant move files within Directories (MSDN).
WAY #2:Semi Path Way:
ren c:\ie\hello.txt hi.txt
ren c:\ie\hello.txt hi.txt
This is a special feature,since this does the same as Way #1 but without telling the Destiny path.So this feature must be implemented also.
@ -35,7 +35,7 @@ So it changes the name of hello.txt in the current directory.
Explaining code:
srcPattern: here is stored Source Argument (C:\ie\hello.txt)
srcPattern: here is stored Source Argument (C:\ie\hello.txt)
srcPath: here is stored Source Path(C:\ie)
srcFILE: here is stored FILE name(hello.txt)
@ -43,7 +43,7 @@ dstPattern: here is stored Destiny Argument (C:\ie\hi.txt)
dstPath: here is stored Destiny Path(C:\i)
dstFILE: here is stored FILE re-name(hi.txt)
1)We begin retrieving arguments from command line and fulfilling dstPattern and srcPattern
1)We begin retrieving arguments from command line and fulfilling dstPattern and srcPattern
2)If srcPattern contains "\" then: