]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
format-table: never try to reuse cells that have color/url/uppercase set 11037/head
authorLennart Poettering <lennart@poettering.net>
Mon, 3 Dec 2018 20:39:39 +0000 (21:39 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 3 Dec 2018 21:42:38 +0000 (22:42 +0100)
The table cell reusing code is supposed to be an internal memory
optimization, and not more. This means behaviour should be the same as
if we wouldn't reuse cells.

src/shared/format-table.c

index 6fdb583a72dc21e1bebf6acb92390dbab190ce81..7d529801a1da81d56ea2c9da3dc081fa4c6ec353 100644 (file)
@@ -270,6 +270,14 @@ static bool table_data_matches(
         if (d->ellipsize_percent != ellipsize_percent)
                 return false;
 
+        /* If a color/url/uppercase flag is set, refuse to merge */
+        if (d->color)
+                return false;
+        if (d->url)
+                return false;
+        if (d->uppercase)
+                return false;
+
         k = table_data_size(type, data);
         l = table_data_size(d->type, d->data);