Commit ec7475f3 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix bug 805953 (Module file corruption after deleting a module).

parent f00696e8
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#endif #endif
#ifndef KICAD_BUILD_VERSION #ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2011-07-04)" #define KICAD_BUILD_VERSION "(2011-07-05)"
#endif #endif
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
; General Product Description Definitions ; General Product Description Definitions
!define PRODUCT_NAME "KiCad" !define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2011.07.04" !define PRODUCT_VERSION "2011.07.05"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/" !define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/" !define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define COMPANY_NAME "" !define COMPANY_NAME ""
......
...@@ -307,7 +307,7 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname ...@@ -307,7 +307,7 @@ void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname
/* Create header with new date. */ /* Create header with new date. */
fprintf( dest, ENTETE_LIBRAIRIE ); fprintf( dest, ENTETE_LIBRAIRIE );
fprintf( dest, " %s\n$", DateAndTime( Line ) ); fprintf( dest, " %s\n", DateAndTime( Line ) );
fprintf( dest, "# encoding utf-8\n"); fprintf( dest, "# encoding utf-8\n");
fprintf( dest, "$INDEX\n" ); fprintf( dest, "$INDEX\n" );
...@@ -556,9 +556,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName, ...@@ -556,9 +556,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
newmodule = 1; end = 0; newmodule = 1; end = 0;
while( !end && GetLine( lib_module, Line, &LineNum ) ) while( !end && GetLine( lib_module, Line, &LineNum ) )
{ {
if( Line[0] != '$' ) if( strncmp( Line, "$INDEX", 6 ) != 0 )
continue;
if( strncmp( Line + 1, "INDEX", 5 ) != 0 )
continue; continue;
while( GetLine( lib_module, Line, &LineNum ) ) while( GetLine( lib_module, Line, &LineNum ) )
...@@ -630,7 +628,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName, ...@@ -630,7 +628,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
while( GetLine( lib_module, Line, &LineNum ) ) while( GetLine( lib_module, Line, &LineNum ) )
{ {
StrPurge( Line ); StrPurge( Line );
if( strnicmp( Line, "$M", 2 ) == 0 ) if( strnicmp( Line, "$MODULE", 7 ) == 0 )
break; break;
if( strnicmp( Line, "$INDEX", 6 ) == 0 ) if( strnicmp( Line, "$INDEX", 6 ) == 0 )
{ {
...@@ -643,7 +641,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName, ...@@ -643,7 +641,7 @@ bool PCB_BASE_FRAME::Save_Module_In_Library( const wxString& aLibName,
} }
if( newmodule ) if( newmodule )
fprintf( dest, "%s\n", TO_UTF8( Name_Cmp ) ); fprintf( dest, "%s\n", TO_UTF8( Name_Cmp ) );
if( strnicmp( Line, "$EndINDEX", 0 ) == 0 ) if( strnicmp( Line, "$EndINDEX", 9 ) == 0 )
break; break;
} }
......
release version: release version:
2011 jul 04 2011 jul 05
files (.zip,.tgz): files (.zip,.tgz):
kicad-2011-07-04 kicad-2011-07-05
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment