From 9da8d2193d4c9c3162e815f4a14a8d86d56ec552 Mon Sep 17 00:00:00 2001 From: oetiker Date: Mon, 22 Jan 2007 10:28:39 +0000 Subject: [PATCH] introduced \n as an alias for \l since people seem to be using it despite the documentation not talking about this ... so now it is official and I bet there will soon be people asking why this was only working at the end of a line. -- tobi git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@967 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/doc/rrdgraph_graph.pod | 3 +++ program/src/rrd_graph.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/program/doc/rrdgraph_graph.pod b/program/doc/rrdgraph_graph.pod index 4543d745..0e4f2556 100644 --- a/program/doc/rrdgraph_graph.pod +++ b/program/doc/rrdgraph_graph.pod @@ -344,6 +344,9 @@ Valid markers are: B<\j> for justified, B<\l> for left aligned, B<\r> for right aligned, and B<\c> for centered. In the next section there is an example showing how to use centered formatting. +B<\n> is a valid alias for B<\l> since incomplete parsing in earlier +versions of rrdtool lead to this behaviour and a number of people has been using it. + Normally there are two space characters inserted between every two items printed into the graph. The space following a string can be suppressed by putting a B<\g> at the end of the string. The B<\g> also ignores any space diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index d785331f..08071884 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -1448,6 +1448,7 @@ leg_place(image_desc_t *im) } /* only valid control codes */ if (prt_fctn != 'l' && + prt_fctn != 'n' && /* a synonym for l */ prt_fctn != 'r' && prt_fctn != 'j' && prt_fctn != 'c' && @@ -1459,7 +1460,12 @@ leg_place(image_desc_t *im) return -1; } + /* remove exess space */ + if ( prt_fcnt == 'n' ){ + prt_fcnt='l'; + } + while (prt_fctn=='g' && leg_cc > 0 && im->gdes[i].legend[leg_cc-1]==' '){ -- 2.30.2