From 888a35bbde0e7d4a9533ac20cb36abec4c8f22b8 Mon Sep 17 00:00:00 2001 From: Mark Visser Date: Sun, 21 May 2023 17:50:35 -0400 Subject: [PATCH] fix bug whereby spice params with capital letters no longer cause an error and data loss Spice parameters were converted to lower-case before comparison. This is incorrect, as it is legal and common for spice parameters to contain capital letters (e.g. potentiometers typically use Rt and SET as their parameters). Spice parameters are not case sensitive, so the correct behaviour is to instead do a case-insensitive comparison on the parameter name. Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793 (cherry picked from commit 0d235ac64b582a70bc09e8db6e59ee673d485188) --- eeschema/sim/sim_model.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index 61d9f24d6f..16e640256d 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include @@ -816,13 +816,11 @@ const SIM_MODEL::PARAM& SIM_MODEL::GetParam( unsigned aParamIndex ) const int SIM_MODEL::doFindParam( const std::string& aParamName ) const { - std::string lowerParamName = boost::to_lower_copy( aParamName ); - std::vector> params = GetParams(); for( int ii = 0; ii < (int) params.size(); ++ii ) { - if( params[ii].get().info.name == lowerParamName ) + if( boost::iequals( params[ii].get().info.name, aParamName ) ) return ii; }