<AWT Dev>  Review request for 8021943: FileDialog getFile returns corrupted string after previous setFile
anthony.petrov at oracle.com
Tue Aug 13 03:24:59 PDT 2013
Please add a comment to the bug report with your evaluation. I suggest
to always do that before sending out a fix for review.
The fix itself looks fine to me.
On 08/01/2013 09:03 PM, Alexander Zvegintsev wrote:
> Could you please review a fix for the following issue:
> The fix is available at:
> lpstrFile should be treated as double NULL terminated (DNT) string only
> when OFN_ALLOWMULTISELECT flag is set.
>> If the *OFN_ALLOWMULTISELECT* flag is set and the user selects
>> multiple files, the buffer contains the current directory followed by
>> the file names of the selected files. For Explorer-style dialog boxes,
>> the directory and file name strings are *NULL* separated, with an
>> extra *NULL* character after the last file name.
> Currently we check length of a lpstrFile with GetBufferLength() which
> treats \0\0 as an end of a string.
> It works nice, unless we call setFile() with a filename longer than a
> path of a saved file (in single-select mode).
> In single-select mode lpstrFile string ends with single \0, and
> GetBufferLength() fails to find correct length and we pass \0-separated
> buffer to
> WFileDialogPeer.handleSelected() which will be treated as multi-select
More information about the awt-dev