summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceUtils.cpp
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2016-01-06 23:50:50 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-01-06 23:50:50 +0000
commitf68f066cdfbd9df6fcab30ed034640c7a81d2cfe (patch)
tree73c55847c9107378ce9edf9b514184a7415aa398 /tools/aapt2/ResourceUtils.cpp
parent457a7e74bebac65cfb1b0c01677116074a7cafac (diff)
parent24b8ff0faf7c59323d0171cdd825ca09e712aa1e (diff)
Merge "AAPT2: Fix references to private parent"
Diffstat (limited to 'tools/aapt2/ResourceUtils.cpp')
-rw-r--r--tools/aapt2/ResourceUtils.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/aapt2/ResourceUtils.cpp b/tools/aapt2/ResourceUtils.cpp
index 36c3e702574e..1dc123e45949 100644
--- a/tools/aapt2/ResourceUtils.cpp
+++ b/tools/aapt2/ResourceUtils.cpp
@@ -176,10 +176,10 @@ bool isAttributeReference(const StringPiece16& str) {
/*
* Style parent's are a bit different. We accept the following formats:
*
- * @[package:]style/<entry>
- * ?[package:]style/<entry>
- * <package>:[style/]<entry>
- * [package:style/]<entry>
+ * @[[*]package:]style/<entry>
+ * ?[[*]package:]style/<entry>
+ * <[*]package>:[style/]<entry>
+ * [[*]package:style/]<entry>
*/
Maybe<Reference> parseStyleParentReference(const StringPiece16& str, std::string* outError) {
if (str.empty()) {
@@ -195,10 +195,11 @@ Maybe<Reference> parseStyleParentReference(const StringPiece16& str, std::string
if (name.data()[0] == u'@' || name.data()[0] == u'?') {
hasLeadingIdentifiers = true;
name = name.substr(1, name.size() - 1);
- if (name.data()[0] == u'*') {
- privateRef = true;
- name = name.substr(1, name.size() - 1);
- }
+ }
+
+ if (name.data()[0] == u'*') {
+ privateRef = true;
+ name = name.substr(1, name.size() - 1);
}
ResourceNameRef ref;