From eff4e2cc9c3e3d20a4e2702be4ccaab18972f01f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 21 Oct 2023 13:30:51 +0100 Subject: [PATCH] Convert windows file paths to unix notation. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15888 --- eeschema/sim/sim_lib_mgr.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/eeschema/sim/sim_lib_mgr.cpp b/eeschema/sim/sim_lib_mgr.cpp index 2d7b87adf6..b580491b36 100644 --- a/eeschema/sim/sim_lib_mgr.cpp +++ b/eeschema/sim/sim_lib_mgr.cpp @@ -55,7 +55,11 @@ void SIM_LIB_MGR::Clear() wxString SIM_LIB_MGR::ResolveLibraryPath( const wxString& aLibraryPath, const PROJECT* aProject ) { - wxString expandedPath = ExpandEnvVarSubstitutions( aLibraryPath, aProject ); + wxString expandedPath = ExpandEnvVarSubstitutions( aLibraryPath, aProject ); + + // Convert it to UNIX format + expandedPath.Replace( '\\', '/' ); + wxFileName fn( expandedPath ); if( fn.IsAbsolute() ) @@ -74,10 +78,10 @@ wxString SIM_LIB_MGR::ResolveLibraryPath( const wxString& aLibraryPath, const PR if( !spiceLibDir.IsEmpty() && spiceLibFn.MakeAbsolute( spiceLibDir ) && spiceLibFn.Exists() ) return spiceLibFn.GetFullPath(); - if( projectFn.GetFullPath() == spiceLibFn.GetFullPath() ) + if( spiceLibDir.IsEmpty() || spiceLibFn.GetFullPath() == projectFn.GetFullPath() ) { THROW_IO_ERROR( wxString::Format( _( "Simulation model library not found at '%s'" ), - spiceLibFn.GetFullPath() ) ); + projectFn.GetFullPath() ) ); } else {