summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-04-16 16:22:16 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-04-16 16:22:16 (GMT)
commit9b68e8e927ecf5cf1e9d10fa46407bd8ac5a0a93 (patch)
tree3aa8cfaba778d1803b598e99a164e9b772311864 /src/H5T.c
parent3c5faf9fb63a303b959d7f2c790ee31485daefa2 (diff)
downloadhdf5-9b68e8e927ecf5cf1e9d10fa46407bd8ac5a0a93.zip
hdf5-9b68e8e927ecf5cf1e9d10fa46407bd8ac5a0a93.tar.gz
hdf5-9b68e8e927ecf5cf1e9d10fa46407bd8ac5a0a93.tar.bz2
[svn-r10620] Purpose:
Bug fix Description: Opening a dataset (or named datatype) with "." for the name and using a group ID for the location ID was not returning an error value. Solution: Check the type of the object before attempting to open it (internally, using a group ID and "." for the name maps to the group object). Platforms tested: FreeBSD 4.11 (sleipnir) Solaris 2.9 (shanti) Too minor to require h5committest
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5T.c b/src/H5T.c
index fe4e9c3..bc20caf 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1578,6 +1578,10 @@ H5Topen(hid_t loc_id, const char *name)
if (H5G_find (loc, name, NULL, &ent/*out*/, dxpl_id)<0)
HGOTO_ERROR (H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found");
+ /* Check that the object found is the correct type */
+ if (H5G_get_type(&ent, dxpl_id) != H5G_TYPE)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a named datatype")
+
/* Open it */
if ((type=H5T_open (&ent, dxpl_id)) ==NULL)
HGOTO_ERROR (H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named data type");