Fix duplicate directives in Spice netlist inside .control ... .endc

Fixes: lp:1812082
https://bugs.launchpad.net/kicad/+bug/1812082
This commit is contained in:
joel-bertrand-JKB
2019-01-16 19:54:03 +01:00
committed by jean-pierre charras
parent cdadb48d84
commit 2d5752f51d
@@ -3,7 +3,7 @@
*
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.TXT for contributors.
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -439,6 +439,7 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
else if( lowercaseline.IsSameAs( ".control" ) && ( !controlBlock ) )
{
controlBlock = true;
m_directives.push_back( line );
}
else if( lowercaseline.IsSameAs( ".endc" ) && controlBlock )
{
@@ -453,11 +454,6 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
m_directives.push_back( line );
}
if( controlBlock )
{
m_directives.push_back( line );
}
// Mark directive as started or continued in case it is a multi-line one
directiveStarted = line.StartsWith( '.' )
|| ( directiveStarted && line.StartsWith( '+' ) );