mirror of https://github.com/ecmwf/eccodes.git
ECC-134: Case-sensitivity of codetable keys
This commit is contained in:
parent
f7133a116e
commit
c6b93677dd
|
@ -595,10 +595,10 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t *len)
|
|||
|
||||
typedef int (*cmpproc)(const char*, const char*);
|
||||
#ifndef ECCODES_ON_WINDOWS
|
||||
cmpproc cmp = (a->flags | GRIB_ACCESSOR_FLAG_LOWERCASE) ? grib_strcasecmp : strcmp;
|
||||
cmpproc cmp = (a->flags & GRIB_ACCESSOR_FLAG_LOWERCASE) ? grib_strcasecmp : strcmp;
|
||||
#else
|
||||
/* Microsoft Windows Visual Studio support */
|
||||
cmpproc cmp = (a->flags | GRIB_ACCESSOR_FLAG_LOWERCASE) ? stricmp : strcmp;
|
||||
cmpproc cmp = (a->flags & GRIB_ACCESSOR_FLAG_LOWERCASE) ? stricmp : strcmp;
|
||||
#endif
|
||||
|
||||
if(!self->table) self->table = load_table(self);
|
||||
|
|
|
@ -73,5 +73,27 @@ hourEnd=$1; dayEnd=$2
|
|||
[ "$hourEnd" = "0" ]
|
||||
[ "$dayEnd" = "6" ]
|
||||
|
||||
|
||||
# ECC-134 case-sensitivity
|
||||
grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
||||
grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
||||
temp=temp.step.$$.grib
|
||||
# M is for Month (code 3)
|
||||
${tools_dir}grib_set -s indicatorOfUnitOfTimeRange=M $grib1_sample $temp
|
||||
unit=`${tools_dir}grib_get -p unitOfTimeRange $temp`
|
||||
[ "$unit" = "3" ]
|
||||
${tools_dir}grib_set -s indicatorOfUnitOfTimeRange=M $grib2_sample $temp
|
||||
unit=`${tools_dir}grib_get -p indicatorOfUnitOfTimeRange $temp`
|
||||
[ "$unit" = "3" ]
|
||||
|
||||
# m is for Minute (code 0)
|
||||
${tools_dir}grib_set -s indicatorOfUnitOfTimeRange=m $grib1_sample $temp
|
||||
unit=`${tools_dir}grib_get -p unitOfTimeRange $temp`
|
||||
[ "$unit" = "0" ]
|
||||
${tools_dir}grib_set -s indicatorOfUnitOfTimeRange=m $grib2_sample $temp
|
||||
unit=`${tools_dir}grib_get -p indicatorOfUnitOfTimeRange $temp`
|
||||
[ "$unit" = "0" ]
|
||||
|
||||
rm -f $temp
|
||||
rm -f $grib2File.p8tmp ${grib2File}.tmp | true
|
||||
rm -f x.grib
|
||||
|
|
Loading…
Reference in New Issue