user32: DlgDirSelect tacks on a period on filenames without ext.

This commit is contained in:
Alex Villacís Lasso 2007-11-10 18:09:08 -05:00 committed by Alexandre Julliard
parent 08d945dadd
commit c4a77bd510
1 changed files with 11 additions and 2 deletions

View File

@ -1683,7 +1683,7 @@ static BOOL DIALOG_DlgDirSelect( HWND hwnd, LPWSTR str, INT len,
size = SendMessageW(listbox, combo ? CB_GETLBTEXTLEN : LB_GETTEXTLEN, item, 0 );
if (size == LB_ERR) return FALSE;
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, (size+1) * sizeof(WCHAR) ))) return FALSE;
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, (size+2) * sizeof(WCHAR) ))) return FALSE;
SendMessageW( listbox, combo ? CB_GETLBTEXT : LB_GETTEXT, item, (LPARAM)buffer );
@ -1701,7 +1701,16 @@ static BOOL DIALOG_DlgDirSelect( HWND hwnd, LPWSTR str, INT len,
ptr = buffer + 1;
}
}
else ptr = buffer;
else
{
/* Filenames without a dot extension must have one tacked at the end */
if (strchrW(buffer, '.') == NULL)
{
buffer[strlenW(buffer)+1] = '\0';
buffer[strlenW(buffer)] = '.';
}
ptr = buffer;
}
if (!unicode)
{