[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-180-gdc402ee)



The branch, master has been updated
       via  dc402ee9c0b5196634c83ed8fd2e2f059a4338cb (commit)
      from  05d7c0a430e2334fc24f561268f5dbcee62d14ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gattrib/src/s_attrib.c     |    2 +-
 gattrib/src/s_object.c     |    4 ++--
 gattrib/src/s_sheet_data.c |    5 +++--
 gattrib/src/s_table.c      |    8 ++++++--
 gattrib/src/s_toplevel.c   |    9 +++++----
 5 files changed, 17 insertions(+), 11 deletions(-)


=================
 Commit Messages
=================

commit dc402ee9c0b5196634c83ed8fd2e2f059a4338cb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 24 03:29:50 2008 +0100

    Revert commit #17cd47a31a4b84d02726391f980ae493d927809b
    
      (Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>)
      (Date:   Fri Jul 11 16:03:06 2008 +0200)
    
          Use o_attrib_get_name_value() to parse attribute strings in gattrib.
    
          Replaced u_basic_breakup_string() with o_attrib_get_name_value() in
          gattrib when splitting attribute string for name and/or value.
    
    This commit introduced a crash saving certain schematics.
    
    It appears to be caused because gattrib uses invalid attribute strings
    such as "attrib_name=" to mark objects which do not have a particular
    attribute present (or that it was deleted during editing).
    
    Since o_attrib_get_name_value() can only processes valid attribute
    strings, it is useless for parsing strings such as these.
    
    Since it isn't immediately clear how many of the o_attrib_get_name_value()
    calls introduced in the above commit are affected by this
    (specifically, where in gattrib these invalid strings are encountered),
    I'm reverting the whole patch rather than trying to build a fix on top.

:100644 100644 67f8a15... 44a4ebf... M	gattrib/src/s_attrib.c
:100644 100644 d48ebf4... 710c3eb... M	gattrib/src/s_object.c
:100644 100644 de0ec64... 52a8663... M	gattrib/src/s_sheet_data.c
:100644 100644 1404223... 7be8782... M	gattrib/src/s_table.c
:100644 100644 9edcdde... 716e29b... M	gattrib/src/s_toplevel.c

=========
 Changes
=========

commit dc402ee9c0b5196634c83ed8fd2e2f059a4338cb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 24 03:29:50 2008 +0100

    Revert commit #17cd47a31a4b84d02726391f980ae493d927809b
    
      (Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>)
      (Date:   Fri Jul 11 16:03:06 2008 +0200)
    
          Use o_attrib_get_name_value() to parse attribute strings in gattrib.
    
          Replaced u_basic_breakup_string() with o_attrib_get_name_value() in
          gattrib when splitting attribute string for name and/or value.
    
    This commit introduced a crash saving certain schematics.
    
    It appears to be caused because gattrib uses invalid attribute strings
    such as "attrib_name=" to mark objects which do not have a particular
    attribute present (or that it was deleted during editing).
    
    Since o_attrib_get_name_value() can only processes valid attribute
    strings, it is useless for parsing strings such as these.
    
    Since it isn't immediately clear how many of the o_attrib_get_name_value()
    calls introduced in the above commit are affected by this
    (specifically, where in gattrib these invalid strings are encountered),
    I'm reverting the whole patch rather than trying to build a fix on top.

diff --git a/gattrib/src/s_attrib.c b/gattrib/src/s_attrib.c
index 67f8a15..44a4ebf 100644
--- a/gattrib/src/s_attrib.c
+++ b/gattrib/src/s_attrib.c
@@ -57,7 +57,7 @@ int s_attrib_name_in_list(STRING_LIST *name_value_list, char *name)
     if (local_list_item->data == NULL)
       continue;
 
-    o_attrib_get_name_value(local_list_item->data, &local_name, NULL);
+    local_name = u_basic_breakup_string(local_list_item->data, '=', 0);
     if (strcmp(local_name, name) == 0) {
       g_free (local_name);
       return TRUE;
diff --git a/gattrib/src/s_object.c b/gattrib/src/s_object.c
index d48ebf4..710c3eb 100644
--- a/gattrib/src/s_object.c
+++ b/gattrib/src/s_object.c
@@ -161,7 +161,7 @@ void s_object_replace_attrib_in_object(OBJECT *o_current,
       
       /* may need to check more thoroughly here. . . . */
       old_attrib_text = g_strdup(a_current->text->string);
-      o_attrib_get_name_value(old_attrib_text, &old_attrib_name, NULL);
+      old_attrib_name = u_basic_breakup_string(old_attrib_text, '=', 0);
       
       if (strcmp(old_attrib_name, new_attrib_name) == 0) {
 	/* create attrib=value text string & stuff it back into pr_current */
@@ -214,7 +214,7 @@ void s_object_remove_attrib_in_object(OBJECT *o_current, char *new_attrib_name)
       
       /* may need to check more thoroughly here. . . . */
       old_attrib_text = g_strdup(a_current->text->string);
-      o_attrib_get_name_value(old_attrib_text, &old_attrib_name, NULL);
+      old_attrib_name = u_basic_breakup_string(old_attrib_text, '=', 0);
       
       if (strcmp(old_attrib_name, new_attrib_name) == 0) {
 	/* We've found the attrib.  Delete it and then return. */
diff --git a/gattrib/src/s_sheet_data.c b/gattrib/src/s_sheet_data.c
index de0ec64..52a8663 100644
--- a/gattrib/src/s_sheet_data.c
+++ b/gattrib/src/s_sheet_data.c
@@ -201,7 +201,7 @@ void s_sheet_data_add_master_comp_attrib_list_items(OBJECT *start_obj) {
 	  if (a_current->type == OBJ_TEXT
 	      && a_current->text != NULL) {  /* found an attribute */
 	    attrib_text = g_strdup(a_current->text->string);
-	    o_attrib_get_name_value(attrib_text, &attrib_name, NULL);
+	    attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
 
 	      /* Don't include "refdes" or "slot" because they form the row name */
 	      /* Also don't include "net" per bug found by Steve W. -- 4.3.2007, SDB */
@@ -408,7 +408,8 @@ void s_sheet_data_add_master_pin_attrib_list_items(OBJECT *start_obj) {
 		if (pin_attrib->type == OBJ_TEXT
 		    && pin_attrib->text != NULL) {  /* found an attribute */
 		  attrib_text = g_strdup(pin_attrib->text->string);
-		  o_attrib_get_name_value(attrib_text, &attrib_name, &attrib_value);
+		  attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
+		  attrib_value = s_misc_remaining_string(attrib_text, '=', 1);
 		  if ( (strcmp(attrib_name, "pinnumber") != 0) 
 		       && (attrib_value != NULL) ) {  
 		    /* Don't include "pinnumber" because it is already in other master list.
diff --git a/gattrib/src/s_table.c b/gattrib/src/s_table.c
index 1404223..7be8782 100644
--- a/gattrib/src/s_table.c
+++ b/gattrib/src/s_table.c
@@ -285,6 +285,8 @@ void s_table_add_toplevel_comp_items_to_comp_table(OBJECT *start_obj) {
             /* may need to check more thoroughly here. . . . */
             attrib_text = g_strdup(a_current->text->string);
             o_attrib_get_name_value(attrib_text, &attrib_name, &attrib_value);
+            attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
+            attrib_value = s_misc_remaining_string(attrib_text, '=', 1);
 	    old_visibility = a_current->visibility;
 	    old_show_name_value = a_current->show_name_value;
 
@@ -367,7 +369,8 @@ void s_table_add_toplevel_net_items_to_net_table(OBJECT *start_obj) {
             && a_current->object->text != NULL) {  /* found an attribute */
           /* may need to check more thoroughly here. . . . */
           attrib_text = g_strdup(a_current->object->text->string);
-          o_attrib_get_name_value(attrib_text, &attrib_name, &attrib_value);
+          attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
+          attrib_value = s_misc_remaining_string(attrib_text, '=', 1);
           if (strcmp(attrib_name, "netname") != 0) {
             /* Don't include "netname" */
              
@@ -478,7 +481,8 @@ void s_table_add_toplevel_pin_items_to_pin_table(OBJECT *start_obj) {
 	      if (pin_attrib->type == OBJ_TEXT
 		  && pin_attrib->text != NULL) {  /* found an attribute */
 		attrib_text = g_strdup(pin_attrib->text->string);
-		o_attrib_get_name_value(attrib_text, &attrib_name, &attrib_value);
+		attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
+		attrib_value = s_misc_remaining_string(attrib_text, '=', 1);
  
 		if ( (strcmp(attrib_name, "pinnumber") != 0) 
 		     && (attrib_value != 0) ) {
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index 9edcdde..716e29b 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -630,7 +630,7 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
 
       /* Else clause is suggestion from Ales */
 #if 1
-      o_attrib_get_name_value(old_name_value_pair, &old_attrib_name, NULL);
+      old_attrib_name = u_basic_breakup_string(old_name_value_pair, '=', 0);
       if ( (strcmp(old_attrib_name, "refdes") != 0) &&
 	   (strcmp(old_attrib_name, "net") != 0) &&
 	   (strcmp(old_attrib_name, "slot") != 0) &&
@@ -683,7 +683,7 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
 
   /*  Now get the old attrib name & value from complete_comp_attrib_list 
    *  and value from o_current  */
-  o_attrib_get_name_value(local_list->data, &old_attrib_name, NULL);
+  old_attrib_name = u_basic_breakup_string(local_list->data, '=', 0); 
   old_attrib_value = o_attrib_search_name_single_count(o_current, old_attrib_name, 0);
 
 #if DEBUG
@@ -694,7 +694,7 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
 #endif
 
   /*  Next try to get this attrib from new_comp_attrib_list  */
-  o_attrib_get_name_value(local_list->data, &new_attrib_name, NULL);
+  new_attrib_name = u_basic_breakup_string(local_list->data, '=', 0);
   if (s_string_list_in_list(new_comp_attrib_list, local_list->data)) {
     new_attrib_value = s_misc_remaining_string(local_list->data, '=', 1);      
   } else {
@@ -931,7 +931,8 @@ void s_toplevel_update_pin_attribs_in_toplevel(char *refdes, OBJECT *o_pin,
   printf("        In s_toplevel_update_pin_attribs_in_toplevel, handling entry in master list %s .\n", new_name_value_pair);
 #endif
 
-  o_attrib_get_name_value(new_name_value_pair, &new_attrib_name, &new_attrib_value);
+  new_attrib_name = u_basic_breakup_string(new_name_value_pair, '=', 0);
+  new_attrib_value = u_basic_breakup_string(new_name_value_pair, '=', 1);
 
   if (strlen(new_attrib_value) == 0) {
     g_free(new_attrib_value);   




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs