TFileName::Squeezed returns garbage for root folders
Borland's Object Windows Library for the modern age
Brought to you by:
jogybl,
sebas_ledesma
Diff:
A quick fix is for TFileName::Title to check the return value of GetFileTitle and return empty string in this case. It solves the problem with TFileName::Squeezed, which is used by TRecentFiles, but any other users of that method should be aware that they would need to handle empty return strings.
Fixed in trunk in [r5244].
Related
Commit: [r5244]
Fortunately, that is the documented behaviour for TFileName::Title since [r310], when the addition of a note about about returning null string was made. So this issue is simply an implementation bug, and checking the source, it is also present in OWL 5 (no initialisation of the buffer, and no checking of the return value from GetFileTitle).
However, note that the documentation says:
This is isn't quite accurate. I guess what is meant with "directory names" here is "paths ending with a backslash", or to be precise a TFileName object for which TFileName::HasParts (TPart::File) and HasParts(TPart::Ext) return false.
Related
Commit: [r310]
Looks like there is another bug in TFileName::Title:
This fails in UNICODE build mode. The last argument should be the character count (see GetFileTitle documentation):
Edit: This issue was fixed on the trunk in [r5246].
Related
Commit: [r5246]
Last edit: Vidar Hasfjord 2020-09-03
The fixes for these issues have been merged into branches 6.44 [r5247] and 7.0 [r5249].
Related
Commit: [r5247]
Commit: [r5249]
Is this done? If so, change status to "pending" for release.