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 commit0d235ac64b
) (cherry picked from commit888a35bbde
)
This commit is contained in:
parent
dfd11b7596
commit
f9c2f03a44
|
@ -44,7 +44,7 @@
|
|||
#include <sim/sim_lib_mgr.h>
|
||||
#include <sim/sim_library_kibis.h>
|
||||
|
||||
#include <boost/algorithm/string/case_conv.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <pegtl/contrib/parse_tree.hpp>
|
||||
|
||||
|
@ -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<std::reference_wrapper<const PARAM>> 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue