]> granicus.if.org Git - graphviz/commitdiff
Don't reset LexPtr unless file changes. This allows multiple graphs
authorEmden Gansner <erg@research.att.com>
Tue, 8 Nov 2011 18:18:57 +0000 (13:18 -0500)
committerEmden Gansner <erg@research.att.com>
Tue, 8 Nov 2011 18:18:57 +0000 (13:18 -0500)
on the same line.

lib/graph/lexer.c

index b142fb32e9ae9711c39fda45b7466011c46599d9..05452c8096e57463e1be68d3a8a52d7535f79dad 100644 (file)
@@ -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);