[svn-r6000] Purpose:
Bug fix (ID 765 and part of ID 841)
Description:
"h5dump -H" would core dump. It was because the code was not
checking if there was any file argument after option parsing.
It referred to an non-existing filename argument.
There was also some very old but not commented code which allowed
the use of back slash to escape a filename begun with '-'. The
'--' option is better and more common practice.
Solution:
Added code to check if there is still a filename argument after parsing.
(This checking probably should goto inside the option_parsing routine.
Also removed that old code mentioned above.
Platforms tested:
eirene, arabica and modi4
This commit is contained in:
@@ -2740,10 +2740,12 @@ main(int argc, const char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (argv[opt_ind][0] == '\\')
|
||||
fname = &argv[opt_ind][1];
|
||||
else
|
||||
fname = argv[opt_ind];
|
||||
if (argc <= opt_ind) {
|
||||
error_msg(progname, "missing file name\n");
|
||||
usage(progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fname = argv[opt_ind];
|
||||
|
||||
fid = h5tools_fopen(fname, driver, NULL, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user