Ticket #14771 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

incompatible change in r72707

Reported by: troelsk Owned by:
Priority: normal Milestone:
Component: base Version: 2.9-svn
Keywords: wxFileName Cc:
Blocked By: Patch: yes
Blocking:

Description

wxFileName::DirExists() used to drop the file name and do the check on the dir part only.
Patch: restore old behaviour

Attachments

direxists.patch download (388 bytes) - added by troelsk 8 months ago.
Trunk

Change History

Changed 8 months ago by troelsk

Trunk

  Changed 8 months ago by VZ

  • status changed from new to closed
  • resolution set to fixed

(In [72718]) Revert accidental incompatible change to wxFileName::DirExists().

The non-static version tests for the existence of the directory part of the
object only as is explicitly mentioned in the documentation, so do the test on
GetPath() and not GetFullPath() as we did since r72707.

Also add a unit test for this behaviour.

Closes #14771.

  Changed 8 months ago by troelsk

There's a ticking bomb there, referencing a temp string object

const wxString& tempdir = wxFileName::GetTempDir();

[
 http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/tests/filename/filenametest.cpp?r1=72717&r2=72718&pathrev=72718
]

follow-up: ↓ 4   Changed 8 months ago by csomor

the const reference to the temp remains valid until it goes out of scope IIRC

in reply to: ↑ 3   Changed 8 months ago by vadz

Replying to csomor:

the const reference to the temp remains valid until it goes out of scope IIRC

Yes,  exactly.

  Changed 8 months ago by troelsk

Ok thanks!

Note: See TracTickets for help on using tickets.