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
** LINE:val::STACK means no legend, and do STACK
*/
if (colorfound) {
** LINE:val::STACK means no legend, and do STACK
*/
if (colorfound) {
int err=0;
char *linecp = strdup(line);
dprintf("- looking for optional legend\n");
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]);
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;
if (rrd_parse_legend(linecp, eaten, gdp)) err=1;