Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57519 - trunk/libs/program_options/src
From: ghost_at_[hidden]
Date: 2009-11-09 13:12:11


Author: vladimir_prus
Date: 2009-11-09 13:12:10 EST (Mon, 09 Nov 2009)
New Revision: 57519
URL: http://svn.boost.org/trac/boost/changeset/57519

Log:
Don't strip quotes from values.

Fixes #850.
Patch from Sascha Ochsenknecht.

Text files modified:
   trunk/libs/program_options/src/value_semantic.cpp | 18 ++----------------
   1 files changed, 2 insertions(+), 16 deletions(-)

Modified: trunk/libs/program_options/src/value_semantic.cpp
==============================================================================
--- trunk/libs/program_options/src/value_semantic.cpp (original)
+++ trunk/libs/program_options/src/value_semantic.cpp 2009-11-09 13:12:10 EST (Mon, 09 Nov 2009)
@@ -169,15 +169,7 @@
     void validate(any& v, const vector<string>& xs, std::string*, int)
     {
         check_first_occurrence(v);
- string s(get_single_string(xs));
- if (!s.empty() && (
- (*s.begin() == '\'' && *s.rbegin() == '\'') ||
- (*s.begin() == '"' && *s.rbegin() == '"')))
- {
- v = any(s.substr(1, s.size()-2));
- }
- else
- v = any(s);
+ v = any(get_single_string(xs));
     }
 
 #if !defined(BOOST_NO_STD_WSTRING)
@@ -185,13 +177,7 @@
     void validate(any& v, const vector<wstring>& xs, std::string*, int)
     {
         check_first_occurrence(v);
- wstring s(get_single_string(xs));
- if (!s.empty() && (
- (*s.begin() == L'\'' && *s.rbegin() == L'\'') ||
- (*s.begin() == L'"' && *s.rbegin() == L'"')))
- v = any(s.substr(1, s.size()-2));
- else
- v = any(s);
+ v = any(get_single_string(xs));
     }
 #endif
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk