diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2018-06-11 15:29:21 -0700 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2018-06-11 15:57:23 -0700 |
commit | 633d796623f84046ebf9baeccd1ba5bcefc16313 (patch) | |
tree | 731c899533c6a240825cffc2776ffc6791c42abc /tools/aapt2/ResourceParser.cpp | |
parent | e42868974bda97f00dfd63559074bb02c1fc6531 (diff) |
AAPT2: Fix raw string parsing
Trim whitespace of raw strings when parsing xml values. This change
trims the whitespace of style items. For example:
<item name="viewInflaterClass">com.helloworld.Inflater
</item>
This will be trimmed to not include a trailing whitespace.
Bug: 109666819
Test: aapt2_tests
Change-Id: I0c1fbb3abdc7e609316c92e59ccaf0573b07e5a7
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
-rw-r--r-- | tools/aapt2/ResourceParser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp index 089c9e284570..ef5912bfad92 100644 --- a/tools/aapt2/ResourceParser.cpp +++ b/tools/aapt2/ResourceParser.cpp @@ -777,7 +777,8 @@ std::unique_ptr<Item> ResourceParser::ParseXml(xml::XmlPullParser* parser, if (allow_raw_value) { // We can't parse this so return a RawString if we are allowed. return util::make_unique<RawString>( - table_->string_pool.MakeRef(raw_value, StringPool::Context(config_))); + table_->string_pool.MakeRef(util::TrimWhitespace(raw_value), + StringPool::Context(config_))); } return {}; } |