Ticket #14886 (closed defect: fixed)

Opened 6 months ago

Last modified 6 months ago

Use wxSetWorkingDirectory() instead of chdir() with wxString paths

Reported by: kosenko Owned by: vadz
Priority: normal Milestone:
Component: wxGTK Version: 2.9-svn
Keywords: Cc:
Blocked By: Patch: yes
Blocking:

Description

In GTK+ porn with WIN32 backend wxString::fn_str() returns wchar_t strings that are not compatible with chdir(const char *) function.

With applied patch behavior under Linux will not changed and under Windows modified code will work as ::SetCurrentDirectory(m_selectedDirectory.t_str());

Code was broken in r72780 (r72779)

Attachments

gtk_win32_dirdlg_cwd.diff download (0.7 KB) - added by kosenko 6 months ago.

Change History

Changed 6 months ago by kosenko

Changed 6 months ago by vadz

  • owner set to vadz
  • status changed from new to accepted

I'm OK with this patch and will apply it but I wonder if we shouldn't have wxChdir() for consistency (which would map to chdir/_chdir/_wchdir).

Changed 6 months ago by VZ

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

(In [73160]) Use wxSetWorkingDirectory() instead of chdir().

This fixes compilation of wxGTK under Windows after the changes of r72779 and
r72780, where _wchdir() would need to be used but we don't currently have a
wxChdir() CRT function wrapper so use wxSetWorkingDirectory() instead.

Closes #14886.

Note: See TracTickets for help on using tickets.