Fix command line parsing on Windows
This commit is contained in:
parent
76969171c7
commit
70096de4e3
@ -13,8 +13,8 @@ namespace cryfs {
|
|||||||
auto doubleDashIterator = std::find(options.begin(), options.end(), string("--"));
|
auto doubleDashIterator = std::find(options.begin(), options.end(), string("--"));
|
||||||
vector<string> beforeDoubleDash(options.begin(), doubleDashIterator);
|
vector<string> beforeDoubleDash(options.begin(), doubleDashIterator);
|
||||||
vector<string> afterDoubleDash;
|
vector<string> afterDoubleDash;
|
||||||
afterDoubleDash.reserve(options.size()-beforeDoubleDash.size());
|
if (doubleDashIterator != options.end() && doubleDashIterator + 1 != options.end()) {
|
||||||
if (options.end() >= doubleDashIterator+1) {
|
afterDoubleDash.reserve(options.size() - beforeDoubleDash.size() - 1);
|
||||||
std::copy(doubleDashIterator + 1, options.end(), std::back_inserter(afterDoubleDash));
|
std::copy(doubleDashIterator + 1, options.end(), std::back_inserter(afterDoubleDash));
|
||||||
}
|
}
|
||||||
return make_pair(
|
return make_pair(
|
||||||
|
Loading…
Reference in New Issue
Block a user