From: oetiker Date: Fri, 20 Jan 2012 07:57:59 +0000 (+0000) Subject: added a nop control for string formating, so that strings ending in /x are possible... X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=commitdiff_plain;h=f0a0cb7901538324a33a106ea4762f2ada88970b;hp=595e26b48d13bcb8bb2c51a4242c46aa0a0b159c added a nop control for string formating, so that strings ending in /x are possible by entering \x\. fix for #331 git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2262 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/doc/rrdgraph_graph.pod b/doc/rrdgraph_graph.pod index 693b1ed..6d764a3 100644 --- a/doc/rrdgraph_graph.pod +++ b/doc/rrdgraph_graph.pod @@ -380,6 +380,11 @@ to go one line back like this: COMMENT:\u COMMENT:right\r +There is also a 'nop' control for situations where you want a string to +actually end in a backslash character sequence B<\.> + + COMMENT:OS\2\. + When using a proportional font in your graph, the tab characters or the sequence B<\t> will line-up legend elements. Note that the tabs inserted are relative to the start of the current legend diff --git a/src/rrd_graph.c b/src/rrd_graph.c index aa4be90..8417291 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1790,6 +1790,7 @@ int leg_place( prt_fctn != 'j' && prt_fctn != 'c' && prt_fctn != 'u' && + prt_fctn != '.' && prt_fctn != 's' && prt_fctn != '\0' && prt_fctn != 'g') { free(legspace); rrd_set_error @@ -1801,6 +1802,10 @@ int leg_place( if (prt_fctn == 'n') { prt_fctn = 'l'; } + /* \. is a null operation to allow strings ending in \x */ + if (prt_fctn == '.') { + prt_fctn = '\0'; + } /* remove exess space from the end of the legend for \g */ while (prt_fctn == 'g' &&