diff options
| author | 2021-11-11 09:17:33 +0000 | |
|---|---|---|
| committer | 2021-11-11 09:17:33 +0000 | |
| commit | 0ba2a37eafd802d240e602bfdc74fc4cfe0c07cd (patch) | |
| tree | c949d41840c1f4c6c102397ff79814aeb488d272 | |
| parent | 02842ed8649ea98ed4ec5ee64194ce2a64d20759 (diff) | |
| parent | 9109a415b28aea8bf3bf668acbbbcdc28ca197ac (diff) | |
Merge "AAPT Files - Permit invariant filepaths for getting file names"
| -rw-r--r-- | tools/aapt2/util/Files.cpp | 2 | ||||
| -rw-r--r-- | tools/aapt2/util/Files.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/tools/aapt2/util/Files.cpp b/tools/aapt2/util/Files.cpp index 5d57de6a9fb1..be09545abb45 100644 --- a/tools/aapt2/util/Files.cpp +++ b/tools/aapt2/util/Files.cpp @@ -154,7 +154,7 @@ StringPiece GetFilename(const StringPiece& path) { const char* end = path.end(); const char* last_dir_sep = path.begin(); for (const char* c = path.begin(); c != end; ++c) { - if (*c == sDirSep) { + if (*c == sDirSep || *c == sInvariantDirSep) { last_dir_sep = c + 1; } } diff --git a/tools/aapt2/util/Files.h b/tools/aapt2/util/Files.h index 481a4cdb6ad0..e50cb505bf66 100644 --- a/tools/aapt2/util/Files.h +++ b/tools/aapt2/util/Files.h @@ -41,6 +41,8 @@ constexpr const char sDirSep = '/'; constexpr const char sPathSep = ':'; #endif +constexpr const char sInvariantDirSep = '/'; + enum class FileType { kUnknown = 0, kNonexistant, |