]> git.sur5r.net Git - glabels/commitdiff
2006-01-05 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Thu, 5 Jan 2006 07:01:33 +0000 (07:01 +0000)
committerJim Evins <evins@snaught.com>
Thu, 5 Jan 2006 07:01:33 +0000 (07:01 +0000)
* src/merge-properties-dialog.c: (src_changed_cb):
Be extra paranoid before calling strcmp().
* src/merge.c: (gl_merge_set_src):
Don't make (merge == NULL) a critical error.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@580 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/ChangeLog
glabels2/src/merge-properties-dialog.c
glabels2/src/merge.c

index bea3ac54fdee254171749e36da84b969080d2b01..e345e10f51f8dab1406531069f533d6cff6e611b 100644 (file)
@@ -1,3 +1,10 @@
+2006-01-05  Jim Evins  <evins@snaught.com>
+
+       * src/merge-properties-dialog.c: (src_changed_cb):
+               Be extra paranoid before calling strcmp().
+       * src/merge.c: (gl_merge_set_src):
+               Don't make (merge == NULL) a critical error.
+
 2005-12-22  Jim Evins  <evins@snaught.com>
 
        * src/glabels-batch.c: (main):
index d7e22e33a9e35182625c26e63c575ebd670c268b..c21f521a15f395df81368e950292febaf9b1f386 100644 (file)
@@ -486,7 +486,10 @@ src_changed_cb (GtkWidget               *widget,
 
        gl_debug (DEBUG_MERGE, "orig=\"%s\", new=\"%s\"\n", orig_src, src);
 
-       if (!orig_src || strcmp (src, orig_src)) {
+       if (((orig_src == NULL) && (src != NULL)) ||
+           ((orig_src != NULL) && (src == NULL)) ||
+           ((orig_src != NULL) && (src != NULL) && strcmp (src, orig_src)))
+       {
                gl_merge_set_src (dialog->priv->merge, src);
                load_tree (dialog->priv->store, dialog->priv->merge);
        }
index d902b31bc57c2abdf006ea254464501afae265c3..2bba656c94b33f9e4f9ef7bd7e8afff609cb450c 100644 (file)
@@ -433,19 +433,30 @@ gl_merge_set_src (glMerge *merge,
 
        gl_debug (DEBUG_MERGE, "START");
 
-       g_return_if_fail (merge && GL_IS_MERGE (merge));
+       if (merge == NULL)
+       {
+               gl_debug (DEBUG_MERGE, "END (NULL)");
+               return;
+       }
 
-       if ( src == NULL) {
+       g_return_if_fail (GL_IS_MERGE (merge));
 
-               if ( merge->private->src != NULL ) {
+       if ( src == NULL)
+       {
+
+               if ( merge->private->src != NULL )
+               {
                        g_free (merge->private->src);
                }
                merge->private->src = NULL;
                merge_free_record_list (&merge->private->record_list);
 
-       } else {
+       }
+       else
+       {
 
-               if ( merge->private->src != NULL ) {
+               if ( merge->private->src != NULL )
+               {
                        g_free(merge->private->src);
                }
                merge->private->src = g_strdup (src);
@@ -453,7 +464,8 @@ gl_merge_set_src (glMerge *merge,
                merge_free_record_list (&merge->private->record_list);
                        
                merge_open (merge);
-               while ( (record = merge_get_record (merge)) != NULL ) {
+               while ( (record = merge_get_record (merge)) != NULL )
+               {
                        record_list = g_list_append( record_list, record );
                }
                merge_close (merge);