# HG changeset patch # User Medo # Date 1344285166 -7200 # Node ID 0db1780ca93819e5abdd6d03db14ed1bdc6adbb7 # Parent a9ab8067a2d16b4a5b75caa96710607437046eb8 frontlib: prevent writing a "binds" section of the team file when there are no binds diff -r a9ab8067a2d1 -r 0db1780ca938 project_files/frontlib/model/team.c --- a/project_files/frontlib/model/team.c Mon Aug 06 22:32:05 2012 +0200 +++ b/project_files/frontlib/model/team.c Mon Aug 06 22:32:46 2012 +0200 @@ -196,6 +196,9 @@ } static int writeBindingSection(const flib_team *team, flib_ini *ini) { + if(team->bindingCount == 0) { + return 0; + } if(flib_ini_create_section(ini, "binds")) { return -1; } diff -r a9ab8067a2d1 -r 0db1780ca938 project_files/frontlib/model/team.h --- a/project_files/frontlib/model/team.h Mon Aug 06 22:32:05 2012 +0200 +++ b/project_files/frontlib/model/team.h Mon Aug 06 22:32:46 2012 +0200 @@ -87,19 +87,13 @@ } flib_team; /** - * Returns a new team, or NULL on error. name must not be NULL. - * - * The new team is pre-filled with default settings (see hwconsts.h) - */ -flib_team *flib_team_create(const char *name); - -/** * Free all memory associated with the team */ void flib_team_destroy(flib_team *team); /** - * Loads a team, returns NULL on error. + * Loads a team, returns NULL on error. Destroy this team using flib_team_destroy. + * This will not fill in the fields marked as "transient" in the structs above. */ flib_team *flib_team_from_ini(const char *filename);