diff --git a/common/jobs/jobs_output_archive.cpp b/common/jobs/jobs_output_archive.cpp index eca80ee363..3df356c5f4 100644 --- a/common/jobs/jobs_output_archive.cpp +++ b/common/jobs/jobs_output_archive.cpp @@ -24,6 +24,7 @@ #include #include #include +#include JOBS_OUTPUT_ARCHIVE::JOBS_OUTPUT_ARCHIVE() : JOBS_OUTPUT_HANDLER(), @@ -52,6 +53,8 @@ bool JOBS_OUTPUT_ARCHIVE::HandleOutputs( const wxString& baseTempPath, PROJECT* if( outputPath.StartsWith( "~" ) ) outputPath.Replace( "~", wxGetHomeDir(), false ); + outputPath = EnsureFileExtension( outputPath, FILEEXT::ArchiveFileExtension ); + wxFFileOutputStream ostream( outputPath ); if( !ostream.IsOk() ) // issue to create the file. Perhaps not writable dir diff --git a/kicad/dialogs/dialog_destination.cpp b/kicad/dialogs/dialog_destination.cpp index df29450dac..2129e9d602 100644 --- a/kicad/dialogs/dialog_destination.cpp +++ b/kicad/dialogs/dialog_destination.cpp @@ -104,7 +104,19 @@ void DIALOG_DESTINATION::onOutputPathBrowseClicked(wxCommandEvent& event) if( dlg.ShowModal() != wxID_OK ) return; - m_textCtrlOutputPath->SetValue( dlg.GetPath() ); + wxString path = dlg.GetPath(); + + if( m_destination->m_type == JOBSET_DESTINATION_T::ARCHIVE ) + { + wxFileName fn( path ); + + if( fn.GetExt().IsEmpty() ) + fn.SetExt( FILEEXT::ArchiveFileExtension ); + + path = fn.GetFullPath(); + } + + m_textCtrlOutputPath->SetValue( path ); } }