From 0a1eabdaeeb66ed6c5d87f2c9ac06059b464dc5c Mon Sep 17 00:00:00 2001 From: yvs Date: Fri, 8 May 2026 16:55:25 +0400 Subject: [PATCH] csv: preserve blank output fields Port the CSV blank-field behavior from yvs2014/mtr085 so an output order spacer produces an empty CSV column instead of reusing the drop counter callback. Ported-from: yvs2014/mtr085@1871c38c4735112adcecc7cef31091e6d0e7f261 Original-author: yvs --- ui/report.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/report.c b/ui/report.c index 506ac77..acc72c0 100644 --- a/ui/report.c +++ b/ui/report.c @@ -579,6 +579,10 @@ void csv_close( j = ctl->fld_index[ctl->fld_active[i]]; if (j < 0) continue; + if (data_fields[j].key == ' ') { + printf(","); + continue; + } printf("%s,", data_fields[j].title); } printf("\n"); @@ -599,6 +603,10 @@ void csv_close( j = ctl->fld_index[ctl->fld_active[i]]; if (j < 0) continue; + if (data_fields[j].key == ' ') { + printf(","); + continue; + } /* 1000.0 is a temporary hack for stats usec to ms, impacted net_loss. */ if (strchr(data_fields[j].format, 'f')) { @@ -652,6 +660,10 @@ void csv_close( j = ctl->fld_index[ctl->fld_active[i]]; if (j < 0) continue; + if (data_fields[j].key == ' ') { + printf(","); + continue; + } /* 1000.0 is a temporary hack for stats usec to ms, impacted net_loss. */ if (strchr(data_fields[j].format, 'f')) { -- 2.47.3