diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2000-04-05 20:51:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2000-04-05 20:51:27 (GMT) |
commit | d1de790d2530b44d5671452f7db52fdee8e839f5 (patch) | |
tree | b87e5cc6c501fa87e8466c93fa83828676cd82dc /src/H5Gnode.c | |
parent | 88c72b4568f0eef918ab9ca17e1e7c5c0dc2435a (diff) | |
download | hdf5-d1de790d2530b44d5671452f7db52fdee8e839f5.zip hdf5-d1de790d2530b44d5671452f7db52fdee8e839f5.tar.gz hdf5-d1de790d2530b44d5671452f7db52fdee8e839f5.tar.bz2 |
[svn-r2081] Fixed a problem in H5Giterate which was not updating the 'index' paramater for
certain return values from the callback.
Diffstat (limited to 'src/H5Gnode.c')
-rw-r--r-- | src/H5Gnode.c | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c index b0071d5..b99653f 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -1091,39 +1091,45 @@ H5G_node_iterate (H5F_t *f, void UNUSED *_lt_key, haddr_t addr, HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - for (i=0; i<nsyms; i++) name_off[i] = sn->entry[i].name_off; + for (i=0; i<nsyms; i++) + name_off[i] = sn->entry[i].name_off; sn = NULL; /* * Iterate over the symbol table node entries. */ for (i=0, ret_value=0; i<nsyms && 0==ret_value; i++) { - if (bt_udata->skip>0) { - --bt_udata->skip; - } else { - name = H5HL_peek (f, bt_udata->group->ent.cache.stab.heap_addr, - name_off[i]); - assert (name); - n = HDstrlen (name); - if (n+1>sizeof(buf)) { - if (NULL==(s = H5MM_malloc (n+1))) { - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, - "memory allocation failed"); - } - } else { - s = buf; - } - HDstrcpy (s, name); - ret_value = (bt_udata->op)(bt_udata->group_id, s, - bt_udata->op_data); - if (s!=buf) H5MM_xfree (s); - } + if (bt_udata->skip>0) { + --bt_udata->skip; + } else { + name = H5HL_peek (f, bt_udata->group->ent.cache.stab.heap_addr, + name_off[i]); + assert (name); + n = HDstrlen (name); + if (n+1>sizeof(buf)) { + if (NULL==(s = H5MM_malloc (n+1))) { + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, + "memory allocation failed"); + } + } else { + s = buf; + } + HDstrcpy (s, name); + ret_value = (bt_udata->op)(bt_udata->group_id, s, + bt_udata->op_data); + if (s!=buf) + H5MM_xfree (s); + } + + /* Increment the number of entries passed through */ + /* (whether we skipped them or not) */ + bt_udata->final_ent++; } if (ret_value<0) { - HERROR (H5E_SYM, H5E_CANTINIT, "iteration operator failed"); + HERROR (H5E_SYM, H5E_CANTINIT, "iteration operator failed"); } - done: +done: name_off = H5MM_xfree (name_off); FUNC_LEAVE(ret_value); } |