summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Verch <shaun.verch@10gen.com>2013-10-23 22:07:16 -0400
committerShaun Verch <shaun.verch@10gen.com>2013-10-23 22:10:07 -0400
commitd431dc6ca4b15bed750463fccd334d3b681da73e (patch)
tree60835cff1cf78c56ddf8d75c75eb4033a43e7788
parent1a58dde196331e0719ffe36a398f5ab8a93cbad5 (diff)
downloadmongo-d431dc6ca4b15bed750463fccd334d3b681da73e.tar.gz
SERVER-11144 Fix check for positional option in a sub section
-rw-r--r--src/mongo/util/options_parser/option_section.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/util/options_parser/option_section.cpp b/src/mongo/util/options_parser/option_section.cpp
index 94fac882e2c..6a7f8c268f2 100644
--- a/src/mongo/util/options_parser/option_section.cpp
+++ b/src/mongo/util/options_parser/option_section.cpp
@@ -29,11 +29,13 @@ namespace optionenvironment {
// TODO: Make sure the section we are adding does not have duplicate options
Status OptionSection::addSection(const OptionSection& subSection) {
std::list<OptionDescription>::const_iterator oditerator;
- for (oditerator = _options.begin();
- oditerator != _options.end(); oditerator++) {
+ for (oditerator = subSection._options.begin();
+ oditerator != subSection._options.end(); oditerator++) {
if (oditerator->_positionalStart != -1) {
- return Status(ErrorCodes::InternalError,
- "Attempted to add subsection with positional options");
+ StringBuilder sb;
+ sb << "Attempted to add subsection with positional option: "
+ << oditerator->_dottedName;
+ return Status(ErrorCodes::InternalError, sb.str());
}
}
_subSections.push_back(subSection);