]> sigrok.org Git - libsigrok.git/blobdiff - src/input/csv.c
input/csv: trim surrounding whitespace from header line channel names
[libsigrok.git] / src / input / csv.c
index 66cf4bb3c2445af3ad9c8c3c1be36e2d658b03d4..4dcc77b8eaeb19e13999324e230786d8da19ef9f 100644 (file)
@@ -657,10 +657,12 @@ static int make_column_details_from_format(const struct sr_input *in,
                         * line won't get processed another time.
                         */
                        column = column_texts[detail->col_nr - 1];
-                       if (inc->use_header && column && *column)
+                       if (inc->use_header && column && *column) {
+                               column = g_strstrip(column);
                                caption = sr_scpi_unquote_string(column);
-                       else
+                       } else {
                                caption = NULL;
+                       }
                        if (!caption || !*caption)
                                caption = NULL;
                        /*