From 24b8ff0faf7c59323d0171cdd825ca09e712aa1e Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Wed, 16 Dec 2015 14:01:57 -0800 Subject: AAPT2: Fix references to private parent Change-Id: Id4697551b6c8cb6167f562de593006ae3c6158c0 --- tools/aapt2/ResourceUtils.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'tools/aapt2/ResourceUtils.cpp') 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/ - * ?[package:]style/ - * :[style/] - * [package:style/] + * @[[*]package:]style/ + * ?[[*]package:]style/ + * <[*]package>:[style/] + * [[*]package:style/] */ Maybe parseStyleParentReference(const StringPiece16& str, std::string* outError) { if (str.empty()) { @@ -195,10 +195,11 @@ Maybe 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; -- cgit v1.2.3-59-g8ed1b