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
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 */
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;