Commit c4a77bd5 authored by Alex Villacís Lasso's avatar Alex Villacís Lasso Committed by Alexandre Julliard

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

parent 08d945da
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment