]> granicus.if.org Git - graphviz/commitdiff
add non-local names to Cgraph internal map as well as local names
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 1 Aug 2020 18:56:23 +0000 (11:56 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 8 Aug 2020 01:48:49 +0000 (18:48 -0700)
This allows the internal name->id map to track *all* names. Related to #1767.

lib/cgraph/id.c

index 93dc829c08b6b7b5d0d3fe3476155ebf4c270d6a..f64e58ebcb78dbab8d1be0849031cb7fa859258e 100644 (file)
@@ -109,8 +109,10 @@ int agmapnametoid(Agraph_t * g, int objtype, char *str,
     if (str && (str[0] != LOCALNAMEPREFIX)) {
        rv = AGDISC(g, id)->map(AGCLOS(g, id), objtype, str, result,
                                createflag);
-       if (rv)
+       if (rv) {
+           aginternalmapinsert(g, objtype, str, *result);
            return rv;
+       }
     }
 
     if (createflag) {