From 62f543612ff766259bee1fff7e64e5861950cdd9 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 25 Apr 2019 11:00:02 -0400 Subject: [PATCH] ctf: Add dash to stream name suffixes We add numerical suffixes to stream names, if needed, to make them unique. For trace directories, we do something similar and decided to format these suffixes with a dash to avoid confusion if the original name ends with a number. This patch does the same thing but for stream names. Signed-off-by: Simon Marchi Change-Id: I3041fe98bbeb3c122d06e5fa54449ed6e55017bd Reviewed-on: https://review.gerrithub.io/c/eepp/babeltrace/+/452110 Reviewed-by: Philippe Proulx Tested-by: Philippe Proulx --- plugins/ctf/fs-sink/fs-sink-stream.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/ctf/fs-sink/fs-sink-stream.c b/plugins/ctf/fs-sink/fs-sink-stream.c index b0b514a5..187ce281 100644 --- a/plugins/ctf/fs-sink/fs-sink-stream.c +++ b/plugins/ctf/fs-sink/fs-sink-stream.c @@ -119,8 +119,7 @@ GString *make_unique_stream_file_name(struct fs_sink_trace *trace, while (stream_file_name_exists(trace, name->str) && strcmp(name->str, "metadata") == 0) { - g_string_assign(name, san_base->str); - g_string_append_printf(name, "%u", suffix); + g_string_printf(name, "%s-%u", san_base->str, suffix); suffix++; } -- 2.34.1