introduced \n as an alias for \l since people seem to be using it despite
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 22 Jan 2007 10:28:39 +0000 (10:28 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 22 Jan 2007 10:28:39 +0000 (10:28 +0000)
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
src/rrd_graph.c

index 4543d74..0e4f255 100644 (file)
@@ -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.
 
 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
 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
index d785331..0807188 100644 (file)
@@ -1448,6 +1448,7 @@ leg_place(image_desc_t *im)
        }
        /* only valid control codes */
         if (prt_fctn != 'l' && 
        }
        /* only valid control codes */
         if (prt_fctn != 'l' && 
+           prt_fctn != 'n' && /* a synonym for l */
            prt_fctn != 'r' &&
            prt_fctn != 'j' &&
            prt_fctn != 'c' &&
            prt_fctn != 'r' &&
            prt_fctn != 'j' &&
            prt_fctn != 'c' &&
@@ -1459,7 +1460,12 @@ leg_place(image_desc_t *im)
                       return -1;
 
        }
                       return -1;
 
        }
+
         /* remove exess space */
         /* remove exess space */
+        if ( prt_fcnt == 'n' ){
+            prt_fcnt='l';
+        }
+
         while (prt_fctn=='g' && 
               leg_cc > 0 && 
               im->gdes[i].legend[leg_cc-1]==' '){
         while (prt_fctn=='g' && 
               leg_cc > 0 && 
               im->gdes[i].legend[leg_cc-1]==' '){