Also verify that the .dcm is writable when saving library
Fixes https://gitlab.com/kicad/code/kicad/issues/3946
(cherry-picked from b2cc454878
)
This commit is contained in:
parent
d62fde0d79
commit
e6a3e7024d
|
@ -726,8 +726,11 @@ bool LIB_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile )
|
|||
fn = prj.SchSymbolLibTable()->GetFullURI( aLibrary );
|
||||
}
|
||||
|
||||
wxFileName docFileName = fn;
|
||||
docFileName.SetExt( DOC_EXT );
|
||||
|
||||
// Verify the user has write privileges before attempting to save the library file.
|
||||
if( !IsWritable( fn ) )
|
||||
if( !IsWritable( fn ) || !IsWritable( docFileName ) )
|
||||
return false;
|
||||
|
||||
ClearMsgPanel();
|
||||
|
@ -736,9 +739,6 @@ bool LIB_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile )
|
|||
if( !backupFile( fn, "bak" ) )
|
||||
return false;
|
||||
|
||||
wxFileName docFileName = fn;
|
||||
docFileName.SetExt( DOC_EXT );
|
||||
|
||||
// Copy .dcm file to .bck.
|
||||
if( !backupFile( docFileName, "bck" ) )
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue