sink.text.details: don't write empty strings
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 18 Mar 2024 17:59:52 +0000 (13:59 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -0400)
commit35fbda93735515c5f07909a96f2d96f6ebaefabb
tree722703585ecf73de03cbf9f5c554b452f64633c5
parent3c20ac1237c1890169e6ffbb8695860740c93c10
sink.text.details: don't write empty strings

This patch makes a `sink.text.details` not write the value of a trace
environment entry or of a value object when it's an empty string.

This is mostly because I don't like to keep plain text files with
significant trailing whitespaces in this repository, and
`data/plugins/src.ctf.lttng-live/cli-multi-domains.expect` had some,
for example:

    trace_creation_datetime:️▒
    trace_name:▒

where `▒` is a space.

Of course we'll have the same issue if a user string contains only
whitespaces instead of being empty, but since it's unlikely that we'll
do this in our own tests, this patch is good enough for me.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I6be83e2721bc6ce98e1459a7df42e32ccf6b661d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12249
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/text/details/write.c
tests/data/plugins/src.ctf.lttng-live/cli-multi-domains.expect
This page took 0.02385 seconds and 4 git commands to generate.