From 458d20311d970044713333418c46f5384f06b56f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 4 Mar 2020 22:15:10 +0000 Subject: [PATCH] ECC-1088: Samples path --- src/grib_context.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/grib_context.c b/src/grib_context.c index 9532ddbf8..217ccde8a 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -496,6 +496,7 @@ grib_context* grib_context_get_default() } #ifdef ECCODES_DEFINITION_PATH { + /* ECC-1088 */ if (strstr(default_grib_context.grib_definition_files_path, ECCODES_DEFINITION_PATH) == NULL) { char buffer[ECC_PATH_MAXLEN]; ecc_snprintf(buffer, ECC_PATH_MAXLEN, "%s%c%s", default_grib_context.grib_definition_files_path, @@ -514,6 +515,16 @@ grib_context* grib_context_get_default() default_grib_context.grib_samples_path = strdup(buffer); } } +#ifdef ECCODES_SAMPLES_PATH + { + if (strstr(default_grib_context.grib_samples_path, ECCODES_SAMPLES_PATH) == NULL) { + char buffer[ECC_PATH_MAXLEN]; + ecc_snprintf(buffer, ECC_PATH_MAXLEN, "%s%c%s", default_grib_context.grib_samples_path, + ECC_PATH_DELIMITER_CHAR, ECCODES_SAMPLES_PATH); + default_grib_context.grib_samples_path = strdup(buffer); + } + } +#endif grib_context_log(&default_grib_context, GRIB_LOG_DEBUG, "Definitions path: %s", default_grib_context.grib_definition_files_path);