Browse Source

Symbol editor: avoid bug in writability check

If the file exists and is not writeable, but the directory
_is_ writable, this check falsely returned true, even
though it will then try to write to a non-writeable file.
pcb_db
John Beard 1 year ago
parent
commit
d9890e38ff
  1. 5
      eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp

5
eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp

@ -1806,7 +1806,10 @@ bool SCH_IO_KICAD_SEXPR::IsLibraryWritable( const wxString& aLibraryPath )
{
wxFileName fn( aLibraryPath );
return ( fn.FileExists() && fn.IsFileWritable() ) || fn.IsDirWritable();
if( fn.FileExists() )
return fn.IsFileWritable();
return fn.IsDirWritable();
}

Loading…
Cancel
Save