diff --git a/tests/grib_ls.sh b/tests/grib_ls.sh index f702c0747..2a6f6c5ab 100755 --- a/tests/grib_ls.sh +++ b/tests/grib_ls.sh @@ -40,7 +40,13 @@ ${tools_dir}/grib_ls -l 0,0,1 $infile >> $tempLog ${tools_dir}/grib_get -l 0,0,1 $infile >> $tempLog ${tools_dir}/grib_get -p count,step $infile >> $tempLog ${tools_dir}/grib_get -P count $infile >> $tempLog -${tools_dir}/grib_get -i 0 $infile + +# ECC-786 and ECC-791 +result=$( ${tools_dir}/grib_get -p shortName -i 0 $infile ) +[ "$result" = "t 199.078 " ] +result=$( ${tools_dir}/grib_get -i 8191 $infile ) +[ "$result" = "160.852 " ] + files=" reduced_gaussian_lsm.grib1 reduced_gaussian_model_level.grib1 diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index b039c8d0d..fef2950e0 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -1285,7 +1285,7 @@ void grib_print_key_values(grib_runtime_options* options, grib_handle* h) snprintf(value, 32, options->format, v); strlenvalue = (int)strlen(value); width = strlenvalue < options->default_print_width ? options->default_print_width + 2 : strlenvalue + 2; - fprintf(dump_file, "%-*s", (int)width, value); + fprintf(dump_file, "%s%-*s", (written_to_dump?" ":""), (int)width, value); written_to_dump = 1; } if (written_to_dump) {