summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-01-18 22:38:22 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-01-18 22:38:22 (GMT)
commita2fbe6c7d835bb88645940c3f6191669d2df75eb (patch)
tree15039a16b14159e23892a85cf5c8e1c2da462811 /tools
parent6a9b816bde987f6ced009b0b1d1793e43103e013 (diff)
parent3374818d14c11e9177370fe940c966240de34052 (diff)
downloadhdf5-a2fbe6c7d835bb88645940c3f6191669d2df75eb.zip
hdf5-a2fbe6c7d835bb88645940c3f6191669d2df75eb.tar.gz
hdf5-a2fbe6c7d835bb88645940c3f6191669d2df75eb.tar.bz2
Merge pull request #862 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '3374818d14c11e9177370fe940c966240de34052': HDFFV-10393 fix incorrect search for name in h5repack object table
Diffstat (limited to 'tools')
-rw-r--r--tools/src/h5repack/h5repack_filters.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c
index 067ebad..ae0bfd5 100644
--- a/tools/src/h5repack/h5repack_filters.c
+++ b/tools/src/h5repack/h5repack_filters.c
@@ -84,7 +84,8 @@ static int aux_find_obj(const char* name, /* object name from traverse list */
pack_opt_t *options, /* repack options */
pack_info_t *obj /*OUT*/) /* info about object to filter */
{
- char *pdest;
+ char *pdest = NULL;
+ char *pname = NULL;
int result;
unsigned int i;
@@ -94,11 +95,12 @@ static int aux_find_obj(const char* name, /* object name from traverse list */
return (int) i;
}
- pdest = HDstrstr(name, options->op_tbl->objs[i].path);
- result = (int) (pdest - name);
+ pdest = options->op_tbl->objs[i].path;
+ if (pdest[0] == '/') pdest++;
+ pname = name;
+ if (pname[0] == '/') pname++;
- /* found at position 1, meaning without '/' */
- if (pdest != NULL && result == 1) {
+ if (HDstrcmp(pdest, pname) == 0) {
*obj = options->op_tbl->objs[i];
return (int) i;
}