diff --git a/rosapps/cmd/cmd.c b/rosapps/cmd/cmd.c index 7d5c8c68847..4077179cb6b 100644 --- a/rosapps/cmd/cmd.c +++ b/rosapps/cmd/cmd.c @@ -1,4 +1,4 @@ -/* $Id: cmd.c,v 1.24 2001/02/28 22:33:23 ekohl Exp $ +/* $Id: cmd.c,v 1.25 2001/04/26 11:31:33 ekohl Exp $ * * CMD.C - command-line interface. * @@ -746,7 +746,7 @@ ProcessInput (BOOL bFlag) { TCHAR commandline[CMDLINE_LENGTH]; TCHAR readline[CMDLINE_LENGTH]; - LPTSTR tp; + LPTSTR tp = NULL; LPTSTR ip; LPTSTR cp; BOOL bEchoThisLine; @@ -800,7 +800,8 @@ ProcessInput (BOOL bFlag) break; default: - if ((tp = _tcschr (ip, _T('%'))) && (tp<=(unsigned int)strchr(ip,_T(' '))-1)) + if ((tp == _tcschr(ip, _T('%'))) && + (tp <= _tcschr(ip, _T(' '))-1)) { char evar[512]; *tp = _T('\0'); diff --git a/rosapps/cmd/vol.c b/rosapps/cmd/vol.c index e3eae64235e..a37bf263fec 100644 --- a/rosapps/cmd/vol.c +++ b/rosapps/cmd/vol.c @@ -38,25 +38,33 @@ PrintVolumeHeader (LPTSTR pszRootPath) DWORD dwSerialNr; /* get the volume information of the drive */ - if(!GetVolumeInformation (pszRootPath, szVolName, 80, &dwSerialNr, - NULL, NULL, NULL, 0)) - { - ErrorMessage (GetLastError (), _T("")); - return 1; - } + if(!GetVolumeInformation (pszRootPath, + szVolName, + 80, + &dwSerialNr, + NULL, + NULL, + NULL, + 0)) + { + ErrorMessage (GetLastError (), _T("")); + return 1; + } /* print drive info */ ConOutPrintf (_T(" Volume in drive %c:"), pszRootPath[0]); if (szVolName[0] != '\0') - ConOutPrintf (_T(" is %s\n"), szVolName); + ConOutPrintf (_T(" is %s\n"), + szVolName); else ConOutPrintf (_T(" has no label\n")); /* print the volume serial number */ ConOutPrintf (_T(" Volume Serial Number is %04X-%04X\n"), - HIWORD(dwSerialNr), LOWORD(dwSerialNr)); - return 0; + HIWORD(dwSerialNr), + LOWORD(dwSerialNr)); + return 0; } @@ -68,7 +76,7 @@ INT cmd_vol (LPTSTR cmd, LPTSTR param) if (!_tcsncmp (param, _T("/?"), 2)) { ConOutPuts (_T("Displays the disk volume label and serial number, if they exist.\n\n" - "VOL [drive:]")); + "VOL [drive:]")); return 0; } @@ -96,8 +104,8 @@ INT cmd_vol (LPTSTR cmd, LPTSTR param) } /* print the header */ - if (!PrintVolumeHeader (szRootPath)) - return 1; + if (!PrintVolumeHeader (szRootPath)) + return 1; return 0; } diff --git a/rosapps/cmd/where.c b/rosapps/cmd/where.c index 4f189655658..c9f2cef5ea0 100644 --- a/rosapps/cmd/where.c +++ b/rosapps/cmd/where.c @@ -102,29 +102,24 @@ SearchForExecutable (LPCTSTR pFileName, LPTSTR pFullName) *pFullName = _T('\0'); #ifdef _DEBUG - DebugPrintf (_T("SearchForExecutable: \'%s\'\n"), pFileName); + DebugPrintf (_T("SearchForExecutable: \'%s\'\n"), pFileName); #endif - if (_tcschr (pFileName, _T('\\')) != NULL) - { - LPTSTR pFilePart; + if (_tcschr (pFileName, _T('\\')) != NULL) + { + LPTSTR pFilePart; #ifdef _DEBUG - DebugPrintf (_T("Absolute or relative path is given.\n")); + DebugPrintf (_T("Absolute or relative path is given.\n")); #endif - - - - if (GetFullPathName (pFileName, - MAX_PATH, - szPathBuffer, - &pFilePart) ==0) - return FALSE; + if (GetFullPathName (pFileName, + MAX_PATH, + szPathBuffer, + &pFilePart) ==0) + return FALSE; - - if(pFilePart == 0) - return FALSE; - + if(pFilePart == 0) + return FALSE; if (_tcschr (pFilePart, _T('.')) != NULL)