$format_time treats ( and ) as special chars
authorNikolas Garofil <garo@dunaldi.garofil.be>
Wed, 18 Nov 2009 23:21:49 +0000 (00:21 +0100)
committerNikolas Garofil <garo@dunaldi.garofil.be>
Wed, 18 Nov 2009 23:21:49 +0000 (00:21 +0100)
doc/variables.xml
src/timeinfo.c

index 10b4abf..f6001d2 100644 (file)
             </command>
             <option>seconds format</option>
         </term>
-        <listitem>Format time given in seconds. Format is a string
+        <listitem>Format time given in seconds. This var only works when
+       the times_in_seconds configuration setting is on. Format is a string
        that should start and end with a "-char. The "-chars are not
-       part of the output, \w,\d,\h,\m,\s and \\ are replaced by
-       weeks,days,hours,minutes,seconds and \. If you leave out a unit,
+       part of the output, \w,\d,\h,\m,\s,\(,\) and \\ are replaced by
+       weeks,days,hours,minutes,seconds,(,) and \. If you leave out a unit,
        it's value will be expressed in the highest unite lower then the
        one left out. Text between ()-chars will not be visible if a
        replaced unit in this text is 0. If seconds is a decimal number
index df0a2a2..1cb7628 100644 (file)
@@ -229,7 +229,9 @@ void print_format_time(struct text_object *obj, char *p, unsigned int p_max_size
                                                        }
                                                        break;
                                                case '\\':
-                                                       p[output_length] = '\\';
+                                               case '(':
+                                               case ')':
+                                                       p[output_length] = *currentchar;
                                                        output_length++;
                                                        break;
                                                default: