summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-24 20:33:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-24 20:35:17 (GMT)
commit332d60c56dfaa11fdd135088279d15cd5983b3d4 (patch)
treedd77717a4e1732da929d5ff8a0471fa3f005e201 /3rdParty/Boost/src/libs/program_options
parent90c44a10fec26d2a0935b2d62e82b6a5be028373 (diff)
downloadswift-contrib-332d60c56dfaa11fdd135088279d15cd5983b3d4.zip
swift-contrib-332d60c56dfaa11fdd135088279d15cd5983b3d4.tar.bz2
Upgraded Boost to 1.45.0.
Diffstat (limited to '3rdParty/Boost/src/libs/program_options')
-rw-r--r--3rdParty/Boost/src/libs/program_options/src/options_description.cpp7
-rw-r--r--3rdParty/Boost/src/libs/program_options/src/winmain.cpp6
2 files changed, 10 insertions, 3 deletions
diff --git a/3rdParty/Boost/src/libs/program_options/src/options_description.cpp b/3rdParty/Boost/src/libs/program_options/src/options_description.cpp
index bfd113d..0d8dfd4 100644
--- a/3rdParty/Boost/src/libs/program_options/src/options_description.cpp
+++ b/3rdParty/Boost/src/libs/program_options/src/options_description.cpp
@@ -306,6 +306,7 @@ namespace boost { namespace program_options {
bool short_ignore_case) const
{
shared_ptr<option_description> found;
+ bool had_full_match = false;
vector<string> approximate_matches;
vector<string> full_matches;
@@ -323,15 +324,17 @@ namespace boost { namespace program_options {
if (r == option_description::full_match)
{
full_matches.push_back(m_options[i]->key(name));
+ found = m_options[i];
+ had_full_match = true;
}
else
{
// FIXME: the use of 'key' here might not
// be the best approach.
approximate_matches.push_back(m_options[i]->key(name));
+ if (!had_full_match)
+ found = m_options[i];
}
-
- found = m_options[i];
}
if (full_matches.size() > 1)
boost::throw_exception(
diff --git a/3rdParty/Boost/src/libs/program_options/src/winmain.cpp b/3rdParty/Boost/src/libs/program_options/src/winmain.cpp
index 64cc790..8a7c43f 100644
--- a/3rdParty/Boost/src/libs/program_options/src/winmain.cpp
+++ b/3rdParty/Boost/src/libs/program_options/src/winmain.cpp
@@ -30,6 +30,7 @@ namespace boost { namespace program_options {
std::string current;
bool inside_quoted = false;
+ bool empty_quote = false;
int backslash_count = 0;
for(; i != e; ++i) {
@@ -38,6 +39,7 @@ namespace boost { namespace program_options {
// n/2 backslashes and is a quoted block delimiter
if (backslash_count % 2 == 0) {
current.append(backslash_count / 2, '\\');
+ empty_quote = inside_quoted && current.empty();
inside_quoted = !inside_quoted;
// '"' preceded by odd number (n) of backslashes generates
// (n-1)/2 backslashes and is literal quote.
@@ -59,6 +61,7 @@ namespace boost { namespace program_options {
// Space outside quoted section terminate the current argument
result.push_back(current);
current.resize(0);
+ empty_quote = false;
for(;i != e && isspace((unsigned char)*i); ++i)
;
--i;
@@ -74,7 +77,7 @@ namespace boost { namespace program_options {
// If we have non-empty 'current' or we're still in quoted
// section (even if 'current' is empty), add the last token.
- if (!current.empty() || inside_quoted)
+ if (!current.empty() || inside_quoted || empty_quote)
result.push_back(current);
}
return result;
@@ -94,3 +97,4 @@ namespace boost { namespace program_options {
}}
#endif
+