summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 31f6e90)
raw | patch | inline | side by side (parent: 31f6e90)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 7 May 2005 23:26:14 +0000 (23:26 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 7 May 2005 23:26:14 +0000 (23:26 +0000) |
space for drawing the color spats in front of it.
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@505 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@505 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_graph_helper.c | patch | blob | history |
diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c
index b464007d8a09f9ef5104f4248391fd21fa4ae26f..23a44d45ce28d53b9a751d22950c04f01d230e3e 100644 (file)
--- a/src/rrd_graph_helper.c
+++ b/src/rrd_graph_helper.c
@@ -388,20 +388,19 @@ rrd_parse_PVHLAST(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc
** LINE:val::STACK means no legend, and do STACK
*/
if (colorfound) {
- char c1,c2;
int err=0;
char *linecp = strdup(line);
dprintf("- looking for optional legend\n");
-
- /* The legend needs to be prefixed with "m ". This then gets
- ** replaced by the color box. */
-
+
dprintf("- examining '%s'\n",&line[*eaten]);
-
- (*eaten)--;
- linecp[*eaten]=' ';
- (*eaten)--;
- linecp[*eaten]='m';
+ if (linecp[*eaten] != '\0' && linecp[*eaten] != ':') {
+ /* If the legend is not empty, it has to be prefixed with "m ". This then gets
+ * replaced by the color box later on. */
+ (*eaten)--;
+ linecp[*eaten]=' ';
+ (*eaten)--;
+ linecp[*eaten]='m';
+ }
if (rrd_parse_legend(linecp, eaten, gdp)) err=1;