From fcc497509a283c144e71b94c0fa645d7618bd957 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sun, 26 Dec 2021 17:02:54 -0500 Subject: [PATCH] Don't treat project Save As path as a path and file name. The single string ctor of wxFileName treats the string as a path and file name. If there is a dot in the last path name, it assumes that the last path is actually a file name and extension. Fixes https://gitlab.com/kicad/code/kicad/-/issues/10116 --- kicad/tools/kicad_manager_control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kicad/tools/kicad_manager_control.cpp b/kicad/tools/kicad_manager_control.cpp index eb028fdab2..580b72330c 100644 --- a/kicad/tools/kicad_manager_control.cpp +++ b/kicad/tools/kicad_manager_control.cpp @@ -561,7 +561,7 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent ) if( dlg.ShowModal() == wxID_CANCEL ) return -1; - wxFileName newProjectDir( dlg.GetPath() ); + wxFileName newProjectDir( dlg.GetPath(), wxEmptyString ); if( !newProjectDir.IsAbsolute() ) newProjectDir.MakeAbsolute(); @@ -592,7 +592,7 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent ) } const wxString& newProjectDirPath = newProjectDir.GetFullPath(); - const wxString& newProjectName = newProjectDir.GetName(); + const wxString& newProjectName = newProjectDir.GetDirs().Last(); wxDir currentProjectDir( currentProjectDirPath ); SAVE_AS_TRAVERSER traverser( m_frame, currentProjectDirPath, currentProjectName,