From 41300834453d2698ff94414a924975abb587b47c Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Thu, 29 Jun 2017 10:36:12 -0400 Subject: [PATCH] Eeschema: fix loading symbol libraries with dot in file name. Initializing wxFileName objects by using string assignment or the single string argument ctor will cause wxFileName to parse everything to the right of the first dot as the file extension. Therefore, file names such as foo.1.lib and bar.baz.lib will fail. This is probably not the only place in the KiCad source where this can occur. Fixes lp:1700331 https://bugs.launchpad.net/kicad/+bug/1700331 --- eeschema/class_library.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 6e37669291..bfcc7a695c 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -585,7 +585,13 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress ) lib_dialog.Update( i, _( "Loading " + lib_names[i] ) ); } - wxFileName fn = lib_names[i]; + wxFileName fn; + + // Do not use string assignment or single string ctor when initializing a wxFileName + // object. File names with dots other than the file extension will be parsed + // incorrectly by wxFileName. + fn.SetName( lib_names[i] ); + // lib_names[] does not store the file extension. Set it: fn.SetExt( SchematicLibraryFileExtension );