]> granicus.if.org Git - graphviz/commitdiff
Make sure backslashes can be escaped in escape strings
authorerg <devnull@localhost>
Wed, 22 Dec 2010 22:54:14 +0000 (22:54 +0000)
committererg <devnull@localhost>
Wed, 22 Dec 2010 22:54:14 +0000 (22:54 +0000)
lib/common/labels.c

index 7fb9dc93c1013b5cc5cccb269d2c24205aaeec56..cf9860e9b93efb949d3da9590762a4c65f310845 100644 (file)
@@ -373,6 +373,9 @@ char *strdup_and_subst_obj(char *str, void *obj)
            case 'L':
                newlen += l_len;
                break; 
+           case '\\':
+               newlen += 1;
+               break; 
            default:  /* leave other escape sequences unmodified, e.g. \n \l \r */
                newlen += 2;
            }
@@ -417,6 +420,9 @@ char *strdup_and_subst_obj(char *str, void *obj)
            case 'L':
                for (t = l_str; (*p = *t++); p++);
                break;
+           case '\\':
+               *p++ = '\\';
+               break;
            default:  /* leave other escape sequences unmodified, e.g. \n \l \r */
                *p++ = '\\';
                *p++ = c;