[CMD] Simplify GetRootPath() and mark its InPath parameter pointer to const string.

This commit is contained in:
Hermès Bélusca-Maïto 2020-07-18 23:31:50 +02:00
parent f43ee81573
commit 47d7de4b7b
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 9 additions and 7 deletions

View file

@ -269,7 +269,12 @@ INT CommandMemory (LPTSTR);
INT cmd_mklink(LPTSTR);
/* Prototypes for MISC.C */
INT GetRootPath(TCHAR *InPath,TCHAR *OutPath,INT size);
INT
GetRootPath(
IN LPCTSTR InPath,
OUT LPTSTR OutPath,
IN INT size);
BOOL SetRootPath(TCHAR *oldpath,TCHAR *InPath);
TCHAR cgetchar (VOID);
BOOL CheckCtrlBreak (INT);

View file

@ -150,7 +150,7 @@
*/
INT
GetRootPath(
IN LPTSTR InPath,
IN LPCTSTR InPath,
OUT LPTSTR OutPath,
IN INT size)
{
@ -162,14 +162,11 @@ GetRootPath(
{
t = (InPath[0] - _T('0')) + 28;
}
if ((InPath[0] >= _T('a')) && (InPath[0] <= _T('z')))
else if ((InPath[0] >= _T('a')) && (InPath[0] <= _T('z')))
{
t = (InPath[0] - _T('a')) + 1;
InPath[0] = t + _T('A') - 1;
}
if ((InPath[0] >= _T('A')) && (InPath[0] <= _T('Z')))
else if ((InPath[0] >= _T('A')) && (InPath[0] <= _T('Z')))
{
t = (InPath[0] - _T('A')) + 1;
}