From 7d022c1a5244aa14b080c51684a181e76e780d73 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Fri, 18 Nov 2016 15:56:51 +0100 Subject: [PATCH] If the indexer name is NULL when creating a column, it now becomes the column name --- src/obidmscolumn.c | 2 +- src/obidmscolumn.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/obidmscolumn.c b/src/obidmscolumn.c index f8cd66d..dc53adf 100644 --- a/src/obidmscolumn.c +++ b/src/obidmscolumn.c @@ -607,7 +607,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms, // Build the indexer name if needed if ((data_type == OBI_STR) || (data_type == OBI_SEQ) || (data_type == OBI_QUAL)) { - if (strcmp(indexer_name, "") == 0) + if ((indexer_name == NULL) || (strcmp(indexer_name, "") == 0)) { final_indexer_name = obi_build_indexer_name(column_name, version_number); if (final_indexer_name == NULL) diff --git a/src/obidmscolumn.h b/src/obidmscolumn.h index ee075c9..4005af9 100644 --- a/src/obidmscolumn.h +++ b/src/obidmscolumn.h @@ -181,6 +181,7 @@ size_t obi_get_platform_header_size(); * @param nb_elements_per_line The number of elements per line. // TODO talk about default values * @param elements_names The names of the elements with ';' as separator. * @param indexer_name The name of the indexer if there is one associated with the column. + * If NULL or "", the indexer name is set as the column name. * @param associated_column_name The name of the associated column if there is one. * @param associated_column_version The version of the associated column if there is one. * @param comments Optional comments associated with the column.