aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/qpdf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'qpdf/qpdf.cc')
-rw-r--r--qpdf/qpdf.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc
index 3d1967d8..1a45180c 100644
--- a/qpdf/qpdf.cc
+++ b/qpdf/qpdf.cc
@@ -1408,8 +1408,25 @@ ArgParser::handleArgFileArguments()
new_argv.push_back(PointerHolder<char>(true, QUtil::copy_string(argv[0])));
for (int i = 1; i < argc; ++i)
{
+ char* argfile = 0;
if ((strlen(argv[i]) > 1) && (argv[i][0] == '@'))
{
+ try
+ {
+ argfile = 1 + argv[i];
+ if (strcmp(argfile, "-") != 0)
+ {
+ fclose(QUtil::safe_fopen(argfile, "rb"));
+ }
+ }
+ catch (std::runtime_error&)
+ {
+ // The file's not there; treating as regular option
+ argfile = 0;
+ }
+ }
+ if (argfile)
+ {
readArgsFromFile(1+argv[i]);
}
else