Patch:    ivtools-140418-scott-011
For:      ivtools-1.2.11
Author:   scott@wavesemi.com
Subject:  support for ipl development

This is an intermediate patch to ivtools-1.2.11.  To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:

	patch -p0 <ThisFile

Then rebuild with "make;make install"


Index: src/GraphUnidraw/nodecomp.c
===================================================================
--- src/GraphUnidraw/nodecomp.c	(revision 8464)
+++ src/GraphUnidraw/nodecomp.c	(working copy)
@@ -182,7 +182,7 @@
       Picture* pic = new Picture();
       SF_Ellipse* ellipse = new SF_Ellipse(0, 0, xradius, yradius, stdgraphic);
       ellipse->SetPattern(unidraw->GetCatalog()->FindGrayLevel(1));
-      TextGraphic* txt = new TextGraphic(graph->GetFile(), stdgraphic);
+      TextGraphic* txt = new TextGraphic(graph->GetFile()?graph->GetFile():"", stdgraphic);
       ellipse->Align(4, txt, 4); // same as Center in IV-2_6/InterViews/alignment.h
       pic->Append(ellipse, txt);
       SetGraphic(pic);
Index: src/Unidraw/ulabel.c
===================================================================
--- src/Unidraw/ulabel.c	(revision 8464)
+++ src/Unidraw/ulabel.c	(working copy)
@@ -42,7 +42,7 @@
     if (gr != nil) {
 	ULabel::SetFont(gr->GetFont());
     }
-    _string = strdup(s);
+    _string = s ? strdup(s) : s;
 }
 
 ULabel::~ULabel () {
Index: src/OverlayUnidraw/ovcomps.c
===================================================================
--- src/OverlayUnidraw/ovcomps.c	(revision 8464)
+++ src/OverlayUnidraw/ovcomps.c	(working copy)
@@ -1008,7 +1008,7 @@
     Graphic* g = comp->GetGraphic();
 
     _comps->Append(new UList(comp));
-    if (g != nil) GetGraphic()->Append(g);
+    if (g != nil && GetGraphic()) GetGraphic()->Append(g);
 
     SetParent(comp, this);
 }
