Code

added a nop control for string formating, so that strings ending in /x are possible...
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Fri, 20 Jan 2012 07:57:59 +0000 (07:57 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Fri, 20 Jan 2012 07:57:59 +0000 (07:57 +0000)
fix for #331

git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2262 a5681a0c-68f1-0310-ab6d-d61299d08faa

doc/rrdgraph_graph.pod
src/rrd_graph.c

index c740aad38c26e05816bbc44711add5af7f7042ca..56a774a07ec9fb84e7eb3ea62401173eb2a0664c 100644 (file)
@@ -372,6 +372,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
index 28a4e4fb401e9e6e06710ebeb03ed01aac024ba3..f40f16f7ff93497e7224dabe0a5343730ddcfa06 100644 (file)
@@ -1772,6 +1772,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
@@ -1783,6 +1784,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' &&