chiark / gitweb /
logs-show: fix condition for ellipsizing multi-line messages
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 21 Aug 2013 05:34:57 +0000 (01:34 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 21 Aug 2013 05:36:51 +0000 (01:36 -0400)
falconindy> the ellipsizing seems a bit wrong here....

I got a bit carried away with putting dots everywhere :)

src/shared/logs-show.c

index 89a73a58609a1f71c6e114b5e876696c2c6ff759..f0236eeae52244681daf70bf77a9ed034ba96c28 100644 (file)
@@ -132,14 +132,14 @@ static bool print_multiline(FILE *f, unsigned prefix, unsigned n_columns, Output
                 len = end - pos;
                 assert(len >= 0);
 
-                /* We need to figure out when we are showing the last line, and
+                /* We need to figure out when we are showing not-last line, *and*
                  * will skip subsequent lines. In that case, we will put the dots
                  * at the end of the line, instead of putting dots in the middle
                  * or not at all.
                  */
                 tail_line =
                         line + 1 == PRINT_LINE_THRESHOLD ||
-                        end + 1 >= message + message_len;
+                        end + 1 >= message + PRINT_CHAR_THRESHOLD;
 
                 if (flags & (OUTPUT_FULL_WIDTH | OUTPUT_SHOW_ALL) ||
                     (prefix + len + 1 < n_columns && !tail_line)) {