mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:25:55 +00:00
* Sync up to trunk head (r64829).
svn path=/branches/shell-experiments/; revision=64830
This commit is contained in:
commit
609ba8d717
709 changed files with 6443 additions and 5701 deletions
|
@ -556,7 +556,7 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
|||
/* Used to find and assemble the string that is returned */
|
||||
TCHAR szBaseWord[MAX_PATH];
|
||||
TCHAR szPrefix[MAX_PATH];
|
||||
TCHAR szOrginal[MAX_PATH];
|
||||
TCHAR szOriginal[MAX_PATH];
|
||||
TCHAR szSearchPath[MAX_PATH];
|
||||
/* Save the strings used last time, so if they hit tab again */
|
||||
static TCHAR LastReturned[MAX_PATH];
|
||||
|
@ -586,9 +586,9 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
|||
if (!_tcsnicmp (line, _T("rd "), 3) || !_tcsnicmp (line, _T("cd "), 3))
|
||||
ShowAll = FALSE;
|
||||
|
||||
/* Copy the string, str can be edited and orginal should not be */
|
||||
/* Copy the string, str can be edited and original should not be */
|
||||
_tcscpy(str,strIN);
|
||||
_tcscpy(szOrginal,strIN);
|
||||
_tcscpy(szOriginal,strIN);
|
||||
|
||||
/* Look to see if the cusor is not at the end of the string */
|
||||
if ((cusor + 1) < _tcslen(str))
|
||||
|
@ -656,8 +656,8 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
|||
hFile = FindFirstFile (szSearchPath, &file);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
/* Assemble the orginal string and return */
|
||||
_tcscpy(strOut,szOrginal);
|
||||
/* Assemble the original string and return */
|
||||
_tcscpy(strOut,szOriginal);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -685,8 +685,8 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
|||
{
|
||||
/* Don't leak old buffer */
|
||||
cmd_free(oldFileList);
|
||||
/* Assemble the orginal string and return */
|
||||
_tcscpy(strOut,szOrginal);
|
||||
/* Assemble the original string and return */
|
||||
_tcscpy(strOut,szOriginal);
|
||||
FindClose(hFile);
|
||||
ConOutFormatMessage (GetLastError());
|
||||
return;
|
||||
|
@ -698,11 +698,10 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
|||
|
||||
FindClose(hFile);
|
||||
|
||||
/* Check the size of the list to see if we
|
||||
found any matches */
|
||||
/* Check the size of the list to see if we found any matches */
|
||||
if (FileListSize == 0)
|
||||
{
|
||||
_tcscpy(strOut,szOrginal);
|
||||
_tcscpy(strOut,szOriginal);
|
||||
if (FileList != NULL)
|
||||
cmd_free(FileList);
|
||||
return;
|
||||
|
@ -712,7 +711,7 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
|||
qsort(FileList,FileListSize,sizeof(FileName), compare);
|
||||
|
||||
/* Find the next/previous */
|
||||
if (!_tcscmp(szOrginal,LastReturned))
|
||||
if (_tcslen(szOriginal) && !_tcscmp(szOriginal,LastReturned))
|
||||
{
|
||||
if (bNext)
|
||||
{
|
||||
|
@ -734,8 +733,7 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
|||
Sel = 0;
|
||||
}
|
||||
|
||||
/* nothing found that matched last time
|
||||
so return the first thing in the list */
|
||||
/* nothing found that matched last time so return the first thing in the list */
|
||||
strOut[0] = _T('\0');
|
||||
|
||||
/* Special character in the name */
|
||||
|
@ -792,7 +790,7 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
|||
}
|
||||
}
|
||||
|
||||
if (szPrefix[_tcslen(szPrefix) - 1] == _T('\"') || NeededQuote)
|
||||
if (NeededQuote || (_tcslen(szPrefix) && szPrefix[_tcslen(szPrefix) - 1] == _T('\"')))
|
||||
_tcscat(strOut,_T("\""));
|
||||
|
||||
_tcscpy(LastReturned,strOut);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue