summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-12-13 20:08:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-12-13 20:08:09 (GMT)
commit8dc49da486ae8a29788d58ca312197e1581c4cb1 (patch)
tree8acf86908b882f99d653691d1cfe5ab63cfc7f74 /src/H5Oattr.c
parent4feb66edc9ded25aacdcd302f9fcf7d7aef4222b (diff)
downloadhdf5-8dc49da486ae8a29788d58ca312197e1581c4cb1.zip
hdf5-8dc49da486ae8a29788d58ca312197e1581c4cb1.tar.gz
hdf5-8dc49da486ae8a29788d58ca312197e1581c4cb1.tar.bz2
[svn-r7950] Purpose:
Bug fix Description: Attributes which were created with scalar dataspaces were reporting their dataspace as a simple dataspace when queried later. Solution: Fix the dataspace handling code when reading in the attribute message from the file to set the extent type correctly. Platforms tested: FreeBSD 4.9 (sleipnir) too minor to require h5committest
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index fdf24a6..8714fdb 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -180,8 +180,16 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *
hsize_t nelem; /* Number of elements in extent */
unsigned u; /* Local index variable */
- attr->ds->extent.type = H5S_SIMPLE;
+ /* Set the dataspace type to be simple or scalar as appropriate */
+ if(simple->rank>0)
+ attr->ds->extent.type = H5S_SIMPLE;
+ else
+ attr->ds->extent.type = H5S_SCALAR;
+
+ /* Copy the extent information */
HDmemcpy(&(attr->ds->extent.u.simple),simple, sizeof(H5S_simple_t));
+
+ /* Release temporary extent information */
H5FL_FREE(H5S_simple_t,simple);
/* Compute the number of elements in the extent */