aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2009-10-14 03:06:18 +0200
committerJay Berkenbilt <ejb@ql.org>2009-10-14 03:06:18 +0200
commit351284b5ec1f0544a37cea41c200227cb762d091 (patch)
tree25edccc493274eb435fbec0180a3529514b89166
parentb2e5c8c93f6b00e22d3eaff708ffe23be33425b6 (diff)
downloadqpdf-351284b5ec1f0544a37cea41c200227cb762d091.tar.zst
make -key not take an argument with a / to appease msys's path translation
git-svn-id: svn+q:///qpdf/trunk@803 71b93d88-0707-0410-a8cf-f5a4172ac649
-rw-r--r--README.windows5
-rw-r--r--examples/pdf-mod-info.cc10
-rw-r--r--examples/qtest/mod-info.test12
3 files changed, 17 insertions, 10 deletions
diff --git a/README.windows b/README.windows
index 6ef5bb9f..7a5e1fe6 100644
--- a/README.windows
+++ b/README.windows
@@ -1,7 +1,10 @@
Common Setup
============
-To be able to run qpdf's test suite, you must have cygwin installed.
+To be able to build qpdf and run its test suite, you must have either
+Cygwin or MSYS from MinGW (>= 1.0.11) installed.
+
+ qpdf's test suite, you must have cygwin installed.
This is because qpdf's test suite uses qtest, which requires cygwin
perl on Windows. (Hopefully a future version of qtest will work with
ActiveState Perl.) You must have at least perl and gnu diffutils
diff --git a/examples/pdf-mod-info.cc b/examples/pdf-mod-info.cc
index 4e851316..45425634 100644
--- a/examples/pdf-mod-info.cc
+++ b/examples/pdf-mod-info.cc
@@ -100,7 +100,7 @@ int main(int argc, char* argv[])
char* fl_in = 0;
char* fl_out = 0;
- char* cur_key = 0;
+ std::string cur_key;
for (int i = 1; i < argc; ++i)
{
@@ -120,18 +120,22 @@ int main(int argc, char* argv[])
{
QTC::TC("examples", "pdf-mod-info -key");
cur_key = argv[i];
+ if (! ((cur_key.length() > 0) && (cur_key[0] == '/')))
+ {
+ cur_key = "/" + cur_key;
+ }
Keys[cur_key] = "";
}
else if ((! strcmp(argv[i], "-val")) && (++i < argc))
{
- if (cur_key == 0)
+ if (cur_key.empty())
{
QTC::TC("examples", "pdf-mod-info usage wrong val");
usage();
}
QTC::TC("examples", "pdf-mod-info -val");
Keys[cur_key] = argv[i];
- cur_key = 0;
+ cur_key.clear();
}
else
{
diff --git a/examples/qtest/mod-info.test b/examples/qtest/mod-info.test
index 90db6276..145bf133 100644
--- a/examples/qtest/mod-info.test
+++ b/examples/qtest/mod-info.test
@@ -34,7 +34,7 @@ $td->runtest("usage #3",
$td->NORMALIZE_NEWLINES);
$td->runtest("usage #4",
- {$td->COMMAND => "$prg -in source1.pdf -key /date -val 01/01/01 -val 12/12/12"},
+ {$td->COMMAND => "$prg -in source1.pdf -key date -val 01/01/01 -val 12/12/12"},
{$td->FILE => "usage.out",
$td->EXIT_STATUS => 2},
$td->NORMALIZE_NEWLINES);
@@ -57,23 +57,23 @@ $td->runtest("dump #3",
$td->EXIT_STATUS => 0});
run_and_cmp("modify Subject",
- "$prg -in files/source1.pdf -out out.pdf -key /Subject " .
+ "$prg -in files/source1.pdf -out out.pdf -key Subject " .
"-val \"Export Business\"",
"", "out.pdf", "files/1.qdf");
run_and_cmp("add Subject, remove Producer, modify CreationDate",
- "$prg -in files/source2.pdf -out out.pdf -key /Subject " .
- "-val \"Tammlin\" -key /Producer -key /CreationDate -val 12/12",
+ "$prg -in files/source2.pdf -out out.pdf -key Subject " .
+ "-val \"Tammlin\" -key Producer -key CreationDate -val 12/12",
"", "out.pdf", "files/2.qdf");
run_and_cmp("add Subject (empty-info file)",
- "$prg -in files/empty-info.pdf -out out.pdf -key /Subject " .
+ "$prg -in files/empty-info.pdf -out out.pdf -key Subject " .
"-val Tammlin",
"", "out.pdf", "files/3.qdf");
copy("files/no-info.pdf", "no-info.pdf") or die "can't copy no-info: $!";
run_and_cmp("in-place Producer added (no-info file)",
- "$prg -in no-info.pdf -key /Producer -val \"Obivan Kinobi\"",
+ "$prg -in no-info.pdf -key Producer -val \"Obivan Kinobi\"",
"", "no-info.pdf", "files/4.qdf");
cleanup();