From b9b586831c64cc699850c3c2fad0c17d576e1e97 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 12 Feb 2015 13:02:45 +0800 Subject: [PATCH] osd: fix OSDCap parser on old boost/spirit * on boost 1.41, the ascii::space skipper fails to skip the spaces at the beginning of the parsed string, so as a workaround we replace the `lit(' ')` in grammar spec with `ascii::blank`. this also simplifies the grammar a little bit. Fixes: #10757 Signed-off-by: Kefu Chai --- src/osd/OSDCap.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osd/OSDCap.cc b/src/osd/OSDCap.cc index 383674fd7665..b9944e57e54c 100644 --- a/src/osd/OSDCap.cc +++ b/src/osd/OSDCap.cc @@ -182,7 +182,7 @@ struct OSDCapParser : qi::grammar str %= quoted_string | unquoted_word; estr %= equoted_string | unquoted_word; - spaces = +(lit(' ') | lit('\n') | lit('\t')); + spaces = +ascii::space; // match := [pool[=] [namespace[=]] | auid <123>] [object_prefix ] @@ -214,12 +214,12 @@ struct OSDCapParser : qi::grammar str [_val = phoenix::construct(_1, string())] )); // grant := allow match capspec - grant = (*lit(' ') >> lit("allow") >> + grant = (*ascii::blank >> lit("allow") >> ((capspec >> match) [_val = phoenix::construct(_2, _1)] | (match >> capspec) [_val = phoenix::construct(_1, _2)]) >> - *lit(' ')); + *ascii::blank); // osdcap := grant [grant ...] - grants %= (grant % (*lit(' ') >> (lit(';') | lit(',')) >> *lit(' '))); + grants %= (grant % (lit(';') | lit(','))); osdcap = grants [_val = phoenix::construct(_1)]; } qi::rule spaces; -- 2.47.3