summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5trav_table.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2003-12-18 20:25:11 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2003-12-18 20:25:11 (GMT)
commit5658d883277c915fa56c111bbb21a487a0659e1f (patch)
treecce6746b89fcc35e491b58b418f8d83c7e4c2900 /tools/lib/h5trav_table.c
parent5b518c102d14f036116e98244fc6856a6c49dc3c (diff)
downloadhdf5-5658d883277c915fa56c111bbb21a487a0659e1f.zip
hdf5-5658d883277c915fa56c111bbb21a487a0659e1f.tar.gz
hdf5-5658d883277c915fa56c111bbb21a487a0659e1f.tar.bz2
[svn-r7971] Purpose:
h5repack bug Description: changed the copy hardlinks algorithm added more tests Solution: Platforms tested: linux solaris IRIX Misc. update:
Diffstat (limited to 'tools/lib/h5trav_table.c')
-rw-r--r--tools/lib/h5trav_table.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/lib/h5trav_table.c b/tools/lib/h5trav_table.c
index 0071559..8e794aa 100644
--- a/tools/lib/h5trav_table.c
+++ b/tools/lib/h5trav_table.c
@@ -235,14 +235,21 @@ void trav_table_addlink(trav_table_t *table,
char *path )
{
int k;
- /* store the link information */
+
+ /* already inserted */
+ if (strcmp(table->objs[j].name,path)==0)
+ return;
+
+ /* allocate space if necessary */
if (table->objs[j].nlinks == table->objs[j].sizelinks) {
table->objs[j].sizelinks += 2;
table->objs[j].links =
(trav_link_t*)HDrealloc(table->objs[j].links,
table->objs[j].sizelinks * sizeof(trav_link_t));
}
- k = table->objs[j].nlinks++;
+
+ /* insert it */
+ k=table->objs[j].nlinks++;
table->objs[j].links[k].new_name = (char*)HDstrdup(path);
}