Merge "Handle empty strings in GetPartitionAbsolutePath."

This commit is contained in:
David Anderson 2019-04-15 18:49:56 +00:00 committed by Gerrit Code Review
commit fcb8b96145

View file

@ -26,6 +26,7 @@
#include <unistd.h>
#include <android-base/file.h>
#include <android-base/strings.h>
#include "utility.h"
@ -37,7 +38,7 @@ using android::base::unique_fd;
namespace {
std::string GetPartitionAbsolutePath(const std::string& path) {
if (path[0] == '/') {
if (android::base::StartsWith(path, "/")) {
return path;
}
return "/dev/block/by-name/" + path;