]> granicus.if.org Git - graphviz/commitdiff
Fix problem in canonical output. At present, a single '.' or '-' is considered a...
authorEmden Gansner <erg@research.att.com>
Tue, 13 Mar 2012 14:29:48 +0000 (10:29 -0400)
committerEmden Gansner <erg@research.att.com>
Tue, 13 Mar 2012 14:29:48 +0000 (10:29 -0400)
left unquoted. They need to be quoted.

lib/cgraph/write.c
lib/graph/graphio.c

index 3f06489f95d42fa01bd7b374fa72b015510cfc26..cd8938187582ff1fd0ed4e14156ed8529651a7e3 100644 (file)
@@ -132,7 +132,7 @@ static char *_agstrcanon(char *arg, char *buf)
     }
     *p++ = '\"';
     *p = '\0';
-    if (needs_quotes)
+    if (needs_quotes || ((cnt == 1) && ((*arg == '.') || (*arg == '-'))))
        return buf;
 
     /* Use quotes to protect tokens (example, a node named "node") */
index a33e9687f035451cbe5c5c8a68bb6d926f70130e..4239ccffd21efe2105d3cd5959f55f776f098c9b 100644 (file)
@@ -172,7 +172,7 @@ _agstrcanon (char* arg, char* buf)
     }
     *p++ = '\"';
     *p = '\0';
-    if (has_special)
+    if (has_special || ((cnt == 1) && ((*arg == '.') || (*arg == '-'))))
        return buf;
 
     /* use quotes to protect tokens (example, a node named "node") */