diff options
| author | Jasper van de Gronde <jasper.vandegronde@gmail.com> | 2008-05-06 11:56:53 +0000 |
|---|---|---|
| committer | jaspervdg <jaspervdg@users.sourceforge.net> | 2008-05-06 11:56:53 +0000 |
| commit | 154e16fc4a392d63ae32284333bf05e8ddb39db4 (patch) | |
| tree | f997af80caa7a22211ef74c197b7dcde02516e82 /src/svg/svg-path.cpp | |
| parent | Updating deprecated type calls. (diff) | |
| download | inkscape-154e16fc4a392d63ae32284333bf05e8ddb39db4.tar.gz inkscape-154e16fc4a392d63ae32284333bf05e8ddb39db4.zip | |
Fix a regression in the SVG path data parser (it will now parse things like "M 1.3.4" correctly again).
(bzr r5618)
Diffstat (limited to 'src/svg/svg-path.cpp')
| -rw-r--r-- | src/svg/svg-path.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp index 36c0b0ce3..460bec922 100644 --- a/src/svg/svg-path.cpp +++ b/src/svg/svg-path.cpp @@ -475,7 +475,7 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, char const *begin) { * At some point we'll need to do all of * http://www.w3.org/TR/SVG11/implnote.html#ErrorProcessing. */ - do { + while(*begin) { double val; char const *end = rsvg_parse_float(&val, begin); if (end != begin) { @@ -515,23 +515,25 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, char const *begin) { } ctx->params[ctx->param++] = val; rsvg_parse_path_do_cmd (ctx, false, 0); // We don't know the next command yet + } else { + char c = *begin; + if (c >= 'A' && c <= 'Z' && c != 'E') { + char next_cmd = c + 'a' - 'A'; + if (ctx->cmd) + rsvg_parse_path_do_cmd (ctx, true, next_cmd); + ctx->cmd = next_cmd; + ctx->rel = false; + } else if (c >= 'a' && c <= 'z' && c != 'e') { + char next_cmd = c; + if (ctx->cmd) + rsvg_parse_path_do_cmd (ctx, true, next_cmd); + ctx->cmd = next_cmd; + ctx->rel = true; + } + /* else c _should_ be whitespace or , */ + begin++; } - char c = *begin; - if (c >= 'A' && c <= 'Z' && c != 'E') { - char next_cmd = c + 'a' - 'A'; - if (ctx->cmd) - rsvg_parse_path_do_cmd (ctx, true, next_cmd); - ctx->cmd = next_cmd; - ctx->rel = false; - } else if (c >= 'a' && c <= 'z' && c != 'e') { - char next_cmd = c; - if (ctx->cmd) - rsvg_parse_path_do_cmd (ctx, true, next_cmd); - ctx->cmd = next_cmd; - ctx->rel = true; - } - /* else c _should_ be whitespace or , */ - } while(*(begin++)); + } if (ctx->cmd) rsvg_parse_path_do_cmd (ctx, true, 0); } |
