From: Emden Gansner Date: Tue, 8 Nov 2011 18:18:57 +0000 (-0500) Subject: Don't reset LexPtr unless file changes. This allows multiple graphs X-Git-Tag: LAST_LIBGRAPH~32^2~603^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff3c0115a73ae01d00766a4555093ea182ff14c1;p=graphviz Don't reset LexPtr unless file changes. This allows multiple graphs on the same line. --- diff --git a/lib/graph/lexer.c b/lib/graph/lexer.c index b142fb32e..05452c809 100644 --- a/lib/graph/lexer.c +++ b/lib/graph/lexer.c @@ -73,12 +73,13 @@ void agsetfile(char *f) void aglexinit(FILE * fp, gets_f mygets) { + if (Lexer_fp != fp) + LexPtr = NULL; Lexer_fp = fp; if (mygets) AG.fgets = mygets; if (AG.fgets == NULL) AG.fgets = fgets; - LexPtr = NULL; if (AG.linebuf == NULL) { LineBufSize = BUFSIZ; AG.linebuf = N_NEW(LineBufSize, char);