user32: DlgDirSelect tacks on a period on filenames without ext.
This commit is contained in:
parent
08d945dadd
commit
c4a77bd510
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue