Make sure N_label is non-null if we are drawing the graph. (27 Mar 2013)
authorEmden R. Gansner <erg@research.att.com>
Mon, 8 Jul 2013 15:18:44 +0000 (11:18 -0400)
committerEmden R. Gansner <erg@research.att.com>
Mon, 8 Jul 2013 15:18:44 +0000 (11:18 -0400)
Remove macro definition of agnodeattr from types.h; this causes problems in gvpack. (28 Mar 2013)
Don't reset line number unless input file changes (9 Apr 2013)

lib/common/input.c

index 56546caaa936e7df59bdd6850c3ef150f0f219a7..85092f521574799891ce1367b020ab2518d6051a 100644 (file)
@@ -570,6 +570,7 @@ graph_t *gvNextInputGraph(GVC_t *gvc)
     graph_t *g = NULL;
     static char *fn;
     static FILE *fp;
+    static FILE *oldfp;
     static int fidx, gidx;
 
     while (!g) {
@@ -587,7 +588,10 @@ graph_t *gvNextInputGraph(GVC_t *gvc)
        }
        if (fp == NULL)
            break;
-       agsetfile(fn ? fn : "<stdin>");
+       if (oldfp != fp) {
+           agsetfile(fn ? fn : "<stdin>");
+           oldfp = fp;
+       }
 #ifdef EXPERIMENTAL_MYFGETS
        g = agread_usergets(fp, myfgets);
 #else
@@ -808,6 +812,12 @@ void graph_init(graph_t * g, boolean use_rankdir)
     N_fontname = agfindnodeattr(g, "fontname");
     N_fontcolor = agfindnodeattr(g, "fontcolor");
     N_label = agfindnodeattr(g, "label");
+    if (!N_label)
+#ifdef WITH_CGRAPH
+       N_label = agattr(g, AGNODE, "label", NODENAME_ESC);
+#else
+       N_label = agnodeattr(g, "label", NODENAME_ESC);
+#endif
     N_xlabel = agfindnodeattr(g, "xlabel");
     N_showboxes = agfindnodeattr(g, "showboxes");
     N_penwidth = agfindnodeattr(g, "penwidth");