From 0bec7e139c6fcee41ce0c6e0ed6804ca04e28dfa Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 31 May 2013 17:45:21 -0700 Subject: [PATCH] mon/MonCap: fix setting of text in parse() Signed-off-by: Sage Weil --- src/mon/MonCap.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mon/MonCap.cc b/src/mon/MonCap.cc index 6f982f6fbabf0..bf8eb6fb79df1 100644 --- a/src/mon/MonCap.cc +++ b/src/mon/MonCap.cc @@ -411,16 +411,18 @@ struct MonCapParser : qi::grammar bool MonCap::parse(const string& str, ostream *err) { - text = str; - string::iterator iter = text.begin(); - string::iterator end = text.end(); + string s = str; + string::iterator iter = s.begin(); + string::iterator end = s.end(); MonCapParser g; bool r = qi::parse(iter, end, g, *this); //MonCapGrant foo; //bool r = qi::phrase_parse(iter, end, g, ascii::space, foo); - if (r && iter == end) + if (r && iter == end) { + text = str; return true; + } // Make sure no grants are kept after parsing failed! grants.clear(); -- 2.39.5