diff options
author | Jay Berkenbilt <ejb@ql.org> | 2009-10-14 03:06:18 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2009-10-14 03:06:18 +0200 |
commit | 351284b5ec1f0544a37cea41c200227cb762d091 (patch) | |
tree | 25edccc493274eb435fbec0180a3529514b89166 /examples/pdf-mod-info.cc | |
parent | b2e5c8c93f6b00e22d3eaff708ffe23be33425b6 (diff) | |
download | qpdf-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
Diffstat (limited to 'examples/pdf-mod-info.cc')
-rw-r--r-- | examples/pdf-mod-info.cc | 10 |
1 files changed, 7 insertions, 3 deletions
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 { |