mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Use explicit conversion to std::string
for look up in Protobuf maps
This is needed for some compiler versions where `absl::string_view` == `std::string_view`. PiperOrigin-RevId: 367392064 Change-Id: Id91d23510501df4745f386475ef9049d94062e1b
This commit is contained in:
parent
6edd16f1b3
commit
17f561f221
|
@ -17,7 +17,7 @@ set(workdir "${CMAKE_BINARY_DIR}/_deps/absl-populate")
|
||||||
set(SAPI_ABSL_GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
|
set(SAPI_ABSL_GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
|
||||||
CACHE STRING "")
|
CACHE STRING "")
|
||||||
set(SAPI_ABSL_GIT_TAG b315753c0b8b4aa4e3e1479375eddb518393bab6
|
set(SAPI_ABSL_GIT_TAG b315753c0b8b4aa4e3e1479375eddb518393bab6
|
||||||
CACHE STRING "") # 2020-11-19
|
CACHE STRING "") # 2021-02-18
|
||||||
set(SAPI_ABSL_SOURCE_DIR "${CMAKE_BINARY_DIR}/_deps/absl-src" CACHE STRING "")
|
set(SAPI_ABSL_SOURCE_DIR "${CMAKE_BINARY_DIR}/_deps/absl-src" CACHE STRING "")
|
||||||
set(SAPI_ABSL_BINARY_DIR "${CMAKE_BINARY_DIR}/_deps/absl-build" CACHE STRING "")
|
set(SAPI_ABSL_BINARY_DIR "${CMAKE_BINARY_DIR}/_deps/absl-build" CACHE STRING "")
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace file_util = ::sapi::file_util;
|
||||||
namespace host_cpu = ::sapi::host_cpu;
|
namespace host_cpu = ::sapi::host_cpu;
|
||||||
|
|
||||||
bool PathContainsNullByte(absl::string_view path) {
|
bool PathContainsNullByte(absl::string_view path) {
|
||||||
return absl::StrContains(path, '\x00');
|
return absl::StrContains(path, '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsSameFile(const std::string& path1, const std::string& path2) {
|
bool IsSameFile(const std::string& path1, const std::string& path2) {
|
||||||
|
@ -277,7 +277,7 @@ absl::StatusOr<std::string> Mounts::ResolvePath(absl::string_view path) const {
|
||||||
while (!tail.empty()) {
|
while (!tail.empty()) {
|
||||||
std::pair<absl::string_view, absl::string_view> parts =
|
std::pair<absl::string_view, absl::string_view> parts =
|
||||||
absl::StrSplit(tail, absl::MaxSplits('/', 1));
|
absl::StrSplit(tail, absl::MaxSplits('/', 1));
|
||||||
absl::string_view cur = parts.first;
|
const std::string cur(parts.first);
|
||||||
tail = parts.second;
|
tail = parts.second;
|
||||||
const auto it = curtree->entries().find(cur);
|
const auto it = curtree->entries().find(cur);
|
||||||
if (it == curtree->entries().end()) {
|
if (it == curtree->entries().end()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user