mirror of
https://github.com/reactos/reactos.git
synced 2025-03-30 17:10:22 +00:00
[CMD]
Add quotes to autocompleted names, when certain characters are present, not only spaces. Not sure if that's really all, but should be the most common. svn path=/trunk/; revision=56350
This commit is contained in:
parent
ece4aa3f3f
commit
24cace2a24
1 changed files with 37 additions and 2 deletions
|
@ -506,6 +506,41 @@ int __cdecl compare(const void *arg1,const void *arg2)
|
|||
return ret;
|
||||
}
|
||||
|
||||
BOOL
|
||||
FileNameContainsSpecialCharacters(LPTSTR pszFileName)
|
||||
{
|
||||
TCHAR chr;
|
||||
|
||||
while ((chr = *pszFileName++) != _T('\0'))
|
||||
{
|
||||
if ((chr == _T(' ')) ||
|
||||
(chr == _T('!')) ||
|
||||
(chr == _T('%')) ||
|
||||
(chr == _T('&')) ||
|
||||
(chr == _T('(')) ||
|
||||
(chr == _T(')')) ||
|
||||
(chr == _T('{')) ||
|
||||
(chr == _T('}')) ||
|
||||
(chr == _T('[')) ||
|
||||
(chr == _T(']')) ||
|
||||
(chr == _T('=')) ||
|
||||
(chr == _T('\'')) ||
|
||||
(chr == _T('`')) ||
|
||||
(chr == _T(',')) ||
|
||||
(chr == _T(';')) ||
|
||||
(chr == _T('^')) ||
|
||||
(chr == _T('~')) ||
|
||||
(chr == _T('+')) ||
|
||||
(chr == 0xB4)) // '´'
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
||||
{
|
||||
/* Length of string before we complete it */
|
||||
|
@ -695,8 +730,8 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
|
|||
so return the first thing in the list */
|
||||
strOut[0] = _T('\0');
|
||||
|
||||
/* space in the name */
|
||||
if(_tcschr(FileList[Sel].Name, _T(' ')))
|
||||
/* Special character in the name */
|
||||
if (FileNameContainsSpecialCharacters(FileList[Sel].Name))
|
||||
{
|
||||
INT LastSpace;
|
||||
BOOL bInside;
|
||||
|
|
Loading…
Reference in a new issue