73 lines
2.2 KiB
Diff
73 lines
2.2 KiB
Diff
|
diff -up netcdf-c-4.4.1/libsrc/dim.c.hashmap netcdf-c-4.4.1/libsrc/dim.c
|
||
|
--- netcdf-c-4.4.1/libsrc/dim.c.hashmap 2016-07-07 07:56:11.162288945 -0600
|
||
|
+++ netcdf-c-4.4.1/libsrc/dim.c 2016-07-07 08:00:16.655658910 -0600
|
||
|
@@ -475,10 +475,12 @@ NC3_rename_dim( int ncid, int dimid, con
|
||
|
free(newname);
|
||
|
if(newStr == NULL)
|
||
|
return NC_ENOMEM;
|
||
|
- dimp->name = newStr;
|
||
|
|
||
|
/* Remove old name from hashmap; add new... */
|
||
|
NC_hashmapRemoveDim(&ncp->dims, old->cp);
|
||
|
+
|
||
|
+ dimp->name = newStr;
|
||
|
+
|
||
|
NC_hashmapAddDim(&ncp->dims, dimid, newStr->cp);
|
||
|
free_NC_string(old);
|
||
|
|
||
|
@@ -487,13 +489,14 @@ NC3_rename_dim( int ncid, int dimid, con
|
||
|
|
||
|
/* else, not in define mode */
|
||
|
|
||
|
+ /* Remove old name from hashmap; add new... */
|
||
|
+ NC_hashmapRemoveDim(&ncp->dims, old->cp);
|
||
|
+
|
||
|
status = set_NC_string(dimp->name, newname);
|
||
|
free(newname);
|
||
|
if(status != NC_NOERR)
|
||
|
return status;
|
||
|
|
||
|
- /* Remove old name from hashmap; add new... */
|
||
|
- NC_hashmapRemoveDim(&ncp->dims, old->cp);
|
||
|
NC_hashmapAddDim(&ncp->dims, dimid, dimp->name->cp);
|
||
|
|
||
|
set_NC_hdirty(ncp);
|
||
|
diff -up netcdf-c-4.4.1/libsrc/var.c.hashmap netcdf-c-4.4.1/libsrc/var.c
|
||
|
--- netcdf-c-4.4.1/libsrc/var.c.hashmap 2016-07-07 07:56:11.162288945 -0600
|
||
|
+++ netcdf-c-4.4.1/libsrc/var.c 2016-07-07 07:58:52.282847833 -0600
|
||
|
@@ -740,14 +740,15 @@ NC3_rename_var(int ncid, int varid, cons
|
||
|
return NC_ENOMEM;
|
||
|
if(NC_indef(ncp))
|
||
|
{
|
||
|
+ /* Remove old name from hashmap; add new... */
|
||
|
+ NC_hashmapRemoveVar(&ncp->vars, old->cp);
|
||
|
+
|
||
|
newStr = new_NC_string(strlen(newname),newname);
|
||
|
free(newname);
|
||
|
if(newStr == NULL)
|
||
|
return(-1);
|
||
|
varp->name = newStr;
|
||
|
|
||
|
- /* Remove old name from hashmap; add new... */
|
||
|
- NC_hashmapRemoveVar(&ncp->vars, old->cp);
|
||
|
NC_hashmapAddVar(&ncp->vars, varid, newStr->cp);
|
||
|
free_NC_string(old);
|
||
|
|
||
|
@@ -755,13 +756,14 @@ NC3_rename_var(int ncid, int varid, cons
|
||
|
}
|
||
|
|
||
|
/* else, not in define mode */
|
||
|
+ /* Remove old name from hashmap; add new... */
|
||
|
+ NC_hashmapRemoveVar(&ncp->vars, old->cp);
|
||
|
+
|
||
|
status = set_NC_string(varp->name, newname);
|
||
|
free(newname);
|
||
|
if(status != NC_NOERR)
|
||
|
return status;
|
||
|
|
||
|
- /* Remove old name from hashmap; add new... */
|
||
|
- NC_hashmapRemoveVar(&ncp->vars, old->cp);
|
||
|
NC_hashmapAddVar(&ncp->vars, varid, varp->name->cp);
|
||
|
|
||
|
set_NC_hdirty(ncp);
|