aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/qpdf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'qpdf/qpdf.cc')
-rw-r--r--qpdf/qpdf.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc
index ae365c70..a1388692 100644
--- a/qpdf/qpdf.cc
+++ b/qpdf/qpdf.cc
@@ -1361,6 +1361,12 @@ int main(int argc, char* argv[])
usage("no output file may be given for this option");
}
+ if (QUtil::same_file(infilename, outfilename))
+ {
+ QTC::TC("qpdf", "qpdf same file error");
+ usage("input file and output file are the same; this would cause input file to be lost");
+ }
+
try
{
QPDF pdf;