From e3e03e09d0319c7606ac0033a8680bd14842e003 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 2 Feb 2021 09:53:30 +0100 Subject: [PATCH] detect_file_type(): update detection to handle last change in .kicad_mod files These files can start now by "(module" or "(footprint". --- pcbnew/footprint_libraries_utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index e593274c1f..65f86f687b 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -111,7 +111,10 @@ static IO_MGR::PCB_FILE_T detect_file_type( FILE* aFile, const wxFileName& aFile reader.ReadLine(); char* line = reader.Line(); - if( !strncasecmp( line, "(module", strlen( "(module" ) ) ) + // first .kicad_mod file versions starts by "(module" + // recent .kicad_mod file versions starts by "(footprint" + if( strncasecmp( line, "(module", strlen( "(module" ) ) == 0 + || strncasecmp( line, "(footprint", strlen( "(footprint" ) ) == 0 ) { file_type = IO_MGR::KICAD_SEXP; *aName = aFileName.GetName();