Merge "AAPT Files - Permit invariant filepaths for getting file names" am: 0ba2a37eaf

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1884590

Change-Id: I9c97f7859fd833fdac44b54e30fb4fc6e6f6255e
This commit is contained in:
Luke Edgar
2021-11-11 10:09:10 +00:00
committed by Automerger Merge Worker
2 changed files with 3 additions and 1 deletions

View File

@@ -154,7 +154,7 @@ StringPiece GetFilename(const StringPiece& path) {
const char* end = path.end(); const char* end = path.end();
const char* last_dir_sep = path.begin(); const char* last_dir_sep = path.begin();
for (const char* c = path.begin(); c != end; ++c) { for (const char* c = path.begin(); c != end; ++c) {
if (*c == sDirSep) { if (*c == sDirSep || *c == sInvariantDirSep) {
last_dir_sep = c + 1; last_dir_sep = c + 1;
} }
} }

View File

@@ -41,6 +41,8 @@ constexpr const char sDirSep = '/';
constexpr const char sPathSep = ':'; constexpr const char sPathSep = ':';
#endif #endif
constexpr const char sInvariantDirSep = '/';
enum class FileType { enum class FileType {
kUnknown = 0, kUnknown = 0,
kNonexistant, kNonexistant,