From: erg Date: Mon, 29 Mar 2010 20:22:04 +0000 (+0000) Subject: Modify block names used when root graph is anonymous. Otherwise, agwrite X-Git-Tag: LAST_LIBGRAPH~32^2~1375 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=525bba04a58f9cc4f3a97562a6937e40e8524028;p=graphviz Modify block names used when root graph is anonymous. Otherwise, agwrite doesn't writ them. --- diff --git a/cmd/tools/bcomps.c b/cmd/tools/bcomps.c index 26e15393a..5b65fc554 100644 --- a/cmd/tools/bcomps.c +++ b/cmd/tools/bcomps.c @@ -102,14 +102,17 @@ static char *blockName(char *gname, int d) static int bufsz; int sz; - sz = strlen(gname) + 32; + sz = strlen(gname) + 128; if (sz > bufsz) { if (buf) free(buf); buf = (char *) malloc(sz); } - sprintf(buf, "%s_bcc_%d", gname, d); + if (*gname == '%') /* anonymous graph */ + sprintf(buf, "_%s_bcc_%d", gname, d); + else + sprintf(buf, "%s_bcc_%d", gname, d); return buf; }