summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-10-19 17:50:28 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-10-19 17:50:28 (GMT)
commitf183ecd3f9f872b41a1b6bc40994e0a8e6de3c9c (patch)
tree3480c7214b7d695f8b6f09054a4be6df3595666c /tools/lib
parenta1a1840d6ef537faabb218842d587f5da609e68f (diff)
downloadhdf5-f183ecd3f9f872b41a1b6bc40994e0a8e6de3c9c.zip
hdf5-f183ecd3f9f872b41a1b6bc40994e0a8e6de3c9c.tar.gz
hdf5-f183ecd3f9f872b41a1b6bc40994e0a8e6de3c9c.tar.bz2
Merge from develop
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5tools_utils.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 1b5911b..a081c7e 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -205,8 +205,9 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
opt_opt = l_opts[i].shortval;
if (l_opts[i].has_arg != no_arg) {
- if (arg[len] == '=')
+ if (arg[len] == '=') {
opt_arg = &arg[len + 1];
+ }
else if (l_opts[i].has_arg != optional_arg) {
if (opt_ind < (argc - 1))
if (argv[opt_ind + 1][0] != '-')
@@ -295,13 +296,16 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
opt_ind++;
/* we do have an extra argument, check if not last */
if ( (opt_ind+1) < argc ) {
- if ( argv[opt_ind][0] != '-' )
+ if ( argv[opt_ind][0] != '-' ) {
opt_arg = argv[opt_ind++];
- else
+ }
+ else {
opt_arg = NULL;
+ }
}
- else
+ else {
opt_arg = NULL;
+ }
}
else {
/* set up to look at next char in token, next time */