Merge branch 'patch-48' of https://github.com/gsjaardema/netcdf-c into v4.8.1-wellspring.wif

This commit is contained in:
Ward Fisher 2021-08-16 10:37:52 -06:00
commit e06d8b744f
2 changed files with 5 additions and 3 deletions

View File

@ -992,9 +992,9 @@ var_create_dataset(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var, nc_bool_t write_dimid
/* Always write the hidden coordinates attribute, which lists the
* dimids of this var. When present, this speeds opens. When no
* present, dimscale matching is used. */
if (var->ndims > 1)
if (var->ndims)
if ((retval = write_coord_dimids(var)))
BAIL(retval);
BAIL(retval);
/* If this is a dimscale, mark it as such in the HDF5 file. Also
* find the dimension info and store the dataset id of the dimscale

View File

@ -550,13 +550,15 @@ main(int argc, char **argv)
if (nc_rename_var(ncid, wind_id, "windy") != NC_ENOTINDEFINE) ERR;
if (nc_rename_var(ncid, wind_id, NULL) != NC_EINVAL) ERR;
#if 0
/* Test disabled until netCDF-4 variable renaming is fixed... */
/* rename variable */
if (nc_rename_var(ncid, wind_id, "wind")) ERR;
/* Enter define mode and rename it to something longer. */
if (nc_redef(ncid)) ERR;
if (nc_rename_var(ncid, wind_id, "windy")) ERR;
if (nc_inq_varid(ncid, "windy", &wind_id)) ERR;
#endif
if (nc_close(ncid)) ERR;
/* Try again without classic. */