From: Emden Gansner Date: Thu, 26 Jan 2012 17:29:49 +0000 (-0500) Subject: Fix html style attribute to accept both rounded and radial X-Git-Tag: LAST_LIBGRAPH~32^2~542 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=606626995648c893efc8dc3194a1bdafde06c979;p=graphviz Fix html style attribute to accept both rounded and radial --- diff --git a/lib/common/htmllex.c b/lib/common/htmllex.c index 116400fd2..068c651a7 100644 --- a/lib/common/htmllex.c +++ b/lib/common/htmllex.c @@ -135,22 +135,30 @@ static int portfn(htmldata_t * p, char *v) return 0; } +#define DELIM " ," + static int stylefn(htmldata_t * p, char *v) { int rv = 0; - char c = toupper(*v); - if (c == 'R') { - if (!strcasecmp(v + 1, "OUNDED")) p->style |= ROUNDED; - else if (!strcasecmp(v + 1, "ADIAL")) p->style |= RADIAL; + char c; + char* tk; + char* buf = strdup (v); + for (tk = strtok (buf, DELIM); tk; tk = strtok (NULL, DELIM)) { + c = toupper(*tk); + if (c == 'R') { + if (!strcasecmp(tk + 1, "OUNDED")) p->style |= ROUNDED; + else if (!strcasecmp(tk + 1, "ADIAL")) p->style |= RADIAL; + else { + agerr(AGWARN, "Illegal value %s for STYLE - ignored\n", tk); + rv = 1; + } + } else { - agerr(AGWARN, "Illegal value %s for STYLE - ignored\n", v); + agerr(AGWARN, "Illegal value %s for STYLE - ignored\n", tk); rv = 1; } } - else { - agerr(AGWARN, "Illegal value %s for STYLE - ignored\n", v); - rv = 1; - } + free (buf); return rv; }