summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-10-19 17:45:17 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-10-19 17:45:17 (GMT)
commitafeaceef5fe47a82cf7dbf536dbbe45cbda72500 (patch)
treea93204a7cedff186491c8dd2acdf34eb651a8551 /tools/lib
parent39eb8e633b0254a80c44f5db5888e4dbe999dd01 (diff)
downloadhdf5-afeaceef5fe47a82cf7dbf536dbbe45cbda72500.zip
hdf5-afeaceef5fe47a82cf7dbf536dbbe45cbda72500.tar.gz
hdf5-afeaceef5fe47a82cf7dbf536dbbe45cbda72500.tar.bz2
Windows had issues - revert code changes for get_option
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 */