From f85f15bfe0ead8d5eb4490df5747c49c46e661ea Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 13 Nov 2005 19:57:09 +0000 Subject: [PATCH] applied SVG patch from Magnus Lundin --- lib/drawer.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/drawer.c b/lib/drawer.c index 329daa8..801ff38 100644 --- a/lib/drawer.c +++ b/lib/drawer.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "drawer.h" static char* getToken(const char**p) @@ -35,7 +36,18 @@ static char* getToken(const char**p) (*p)++; } start = *p; - while(**p && !strchr(" ,()\t\n\r", **p)) { + + /* + SVF pathdata can exclude whitespace after L and M commands. + Ref: http://www.w3.org/TR/SVG11/paths.html#PathDataGeneralInformation + This allows us to use svg files output from gnuplot. + Also checks for relative MoveTo and LineTo (m and l). + 051106 Magnus Lundin, lundin@mlu.mine.nu + */ + if (strchr("LMlm", **p) && (isdigit(*(*p+1))||strchr("+-", *(*p+1)))) { + (*p)++; + } + else while(**p && !strchr(" ,()\t\n\r", **p)) { (*p)++; } result = malloc((*p)-start+1); -- 1.7.10.4