summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2007-11-29 20:20:50 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2007-11-29 20:20:50 (GMT)
commitc4c9f5cf0a9af960bcc024be9b4782e61c6dcc57 (patch)
tree93296f2d8b3e3706e10735a84a1dd99d78a153b2
parent6d4fdcb4a75e5f558ac74b142851d3ba94258149 (diff)
downloadhdf5-c4c9f5cf0a9af960bcc024be9b4782e61c6dcc57.zip
hdf5-c4c9f5cf0a9af960bcc024be9b4782e61c6dcc57.tar.gz
hdf5-c4c9f5cf0a9af960bcc024be9b4782e61c6dcc57.tar.bz2
[svn-r14310] error check in command line: check for a wrong input of the 2 file names being the same
tested: windows, linux
-rw-r--r--tools/h5repack/h5repack_main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index 8221317..116c6cf 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -97,6 +97,14 @@ int main(int argc, char **argv)
{
infile = argv[ opt_ind ];
outfile = argv[ opt_ind + 1 ];
+
+ if ( strcmp( infile, outfile ) == 0 )
+ {
+ error_msg(progname, "file names cannot be the same\n");
+ usage(progname);
+ exit(EXIT_FAILURE);
+
+ }
}
else