- }else if(strcasecmp(line, "bow") == 0) {
- if((bow = (struct matdb_bowing*)malloc(sizeof(struct matdb_bowing))) == NULL) {
- *err &= 128;
- }
- if((to = index(i, ':')) == NULL) {
- *err &= 1024;
- free(bow);
- continue;
- }
- *to++ = '\0';
- /*Same trick as before, but i now stores the from material,
- and to the to material
- */
- if((bow->from = g_string_new(i)) == NULL) {
- *err &= 128;
- free(bow);
- continue;
- }
- if((bow->to = g_string_new(to)) == NULL) {
- *err &= 128;
- g_string_free(bow->from, TRUE);
- free(bow);
- continue;
- }
- if((bow->properties = g_hash_table_new_full(g_str_hash, g_str_equal, &destroy_string, &destroy_double)) == NULL) {
- *err &= 128;
- g_string_free(bow->to, TRUE);
- g_string_free(bow->from, TRUE);
- free(bow);
- continue;
- }
-#ifdef DEBUG
- fprintf(stderr, "new bowing (%s:%s):\n", i, to);
-#endif
- }else{
- *err &= 16;
- section = 0;
+ section=1;
+ }else if(strcasecmp(line, "bow") == 0) {
+ insert_into_matdb(mdb, &mat, &bow);
+ if((bow = (struct matdb_bowing*)malloc(sizeof(struct matdb_bowing))) == NULL) {
+ *err &= 128;
+ }
+ if((to = index(i, ':')) == NULL) {
+ *err &= 1024;
+ free(bow);
+ section=0;
+ continue;
+ }
+ *to++ = '\0';
+ /*Same trick as before, but i now stores the from material,
+ and to the to material
+ */
+ if((bow->from = g_string_new(i)) == NULL) {
+ *err &= 128;
+ free(bow);
+ section=0;
+ continue;
+ }
+ if((bow->to = g_string_new(to)) == NULL) {
+ *err &= 128;
+ g_string_free(bow->from, TRUE);
+ free(bow);
+ section=0;
+ continue;
+ }
+ if((bow->properties = g_hash_table_new_full(&g_str_hash, &g_str_equal, &destroy_string, &destroy_double)) == NULL) {
+ *err &= 128;
+ g_string_free(bow->to, TRUE);
+ g_string_free(bow->from, TRUE);
+ free(bow);
+ section=0;
+ continue;