summaryrefslogtreecommitdiffstats
path: root/src/H5Odtype.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-03-29 23:46:56 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-03-29 23:46:56 (GMT)
commit1c1653aa40acb537d91f37013e5de7ee83e8e052 (patch)
tree2f1f7f3cd1c028ae79265749d890bf1e1d51ba32 /src/H5Odtype.c
parent65d52eaf8e3126d11d8fe2992b12942c01df1776 (diff)
downloadhdf5-1c1653aa40acb537d91f37013e5de7ee83e8e052.zip
hdf5-1c1653aa40acb537d91f37013e5de7ee83e8e052.tar.gz
hdf5-1c1653aa40acb537d91f37013e5de7ee83e8e052.tar.bz2
[svn-r5123]
Purpose: Bug fix(#697) Description: Variable-length string wasn't treated as string. Solution: Added character set and padding into VL string type. Platforms tested: FreeBSD
Diffstat (limited to 'src/H5Odtype.c')
-rw-r--r--src/H5Odtype.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 545531f..ed94cd4 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -352,6 +352,10 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
case H5T_VLEN: /* Variable length datatypes... */
/* Set the type of VL information, either sequence or string */
dt->u.vlen.type = (H5T_vlen_type_t)(flags & 0x0f);
+ if(dt->u.vlen.type == H5T_VLEN_STRING) {
+ dt->u.vlen.pad = (H5T_str_t)((flags>>4) & 0x0f);
+ dt->u.vlen.cset = (H5T_cset_t)((flags>>8) & 0x0f);
+ } /* end if */
/* Decode base type of VL information */
if (NULL==(dt->parent = H5FL_ALLOC(H5T_t,1)))
@@ -730,6 +734,10 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
case H5T_VLEN: /* Variable length datatypes... */
flags |= (dt->u.vlen.type & 0x0f);
+ if(dt->u.vlen.type == H5T_VLEN_STRING) {
+ flags |= (dt->u.vlen.pad & 0x0f) << 4;
+ flags |= (dt->u.vlen.cset & 0x0f) << 8;
+ } /* end if */
/* Encode base type of VL information */
if (H5O_dtype_encode_helper(pp, dt->parent)<0) {