From 04ac0d108d9d1e3ed2930b9e9ba997d1f51ee945 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 10 Feb 2020 14:19:42 +0000 Subject: [PATCH] ECC-1070: bufr_dump -O should not unpack the data section --- src/grib_dumper_class_wmo.c | 9 ++++----- tests/bufr_dump_data.sh | 4 +--- tools/bufr_dump.c | 12 ------------ 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/grib_dumper_class_wmo.c b/src/grib_dumper_class_wmo.c index 7815468d9..6db7f423c 100644 --- a/src/grib_dumper_class_wmo.c +++ b/src/grib_dumper_class_wmo.c @@ -605,8 +605,10 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm int tab = 0; long count = 0; - c = a->context; + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + return; + c = a->context; grib_value_count(a, &count); if (count == 0) return; @@ -624,10 +626,6 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm err = grib_unpack_string_array(a, values, &size); - if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) - return; - - /* print_offset(self->dumper.out,d,a); */ print_offset(self->dumper.out, self->begin, self->theEnd); @@ -662,5 +660,6 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm } fprintf(self->dumper.out, "\n"); + for (i=0; i/dev/null done diff --git a/tools/bufr_dump.c b/tools/bufr_dump.c index abd14fa00..482a1099b 100644 --- a/tools/bufr_dump.c +++ b/tools/bufr_dump.c @@ -506,18 +506,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) sprintf(tmp, "MESSAGE %d ( length=%ld )", options->handle_count, length); if (!grib_options_on("C")) fprintf(stdout, "#============== %-38s ==============\n", tmp); - err = grib_set_long(h, "unpack", 1); - if (err) { - if (options->fail) { - fprintf(stderr, "ERROR: unable to unpack data section: %s\n", grib_get_error_message(err)); - exit(err); - } - else { - fprintf(stdout, "ERROR: unable to unpack data section\n"); - options->error = err; - /*return err; See ECC-723*/ - } - } grib_dump_content(h, stdout, options->dump_mode, options->dump_flags, 0); } else if (dump_descriptors) {