aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--libqpdf/QPDFArgParser.cc2
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8362c189..30bf8ff6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2023-09-03 Jay Berkenbilt <ejb@ql.org>
+ * Put quotation marks around the command in completion output to
+ better handle spaces in paths. It is not a perfect fix (ideally,
+ full shell-compatible quoting should be used), but it handles more
+ cases than the old code and should handle all reasonable cases of
+ qpdf being in a directory with a space in its name, which is
+ common in Windows. Fixes #1021.
+
* Move check for random number device to runtime instead of
compile time. Since, by default, the crypto provider provides
random numbers, runtime determinination of a random number device
diff --git a/libqpdf/QPDFArgParser.cc b/libqpdf/QPDFArgParser.cc
index 3ebec29c..5377b2bc 100644
--- a/libqpdf/QPDFArgParser.cc
+++ b/libqpdf/QPDFArgParser.cc
@@ -193,7 +193,7 @@ QPDFArgParser::completionCommon(bool zsh)
if (!zsh) {
std::cout << " -o nospace";
}
- std::cout << " -C " << progname << " " << m->whoami << std::endl;
+ std::cout << " -C \"" << progname << "\" " << m->whoami << std::endl;
// Put output before error so calling from zsh works properly
std::string path = progname;
size_t slash = path.find('/');