From ff2c56d197fc76e5f54d37fd8830369ca28d1420 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/program@967 a5681a0c-68f1-0310-ab6d-d61299d08faa --- doc/rrdgraph_graph.pod | 3 +++ src/rrd_graph.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/doc/rrdgraph_graph.pod b/doc/rrdgraph_graph.pod index 4543d74..0e4f255 100644 --- a/doc/rrdgraph_graph.pod +++ b/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/src/rrd_graph.c b/src/rrd_graph.c index d785331..0807188 100644 --- a/src/rrd_graph.c +++ b/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