Merge "DO NOT MERGE: Fix bug in product path building" into nyc-mr1-dev
This commit is contained in:
commit
b7dece1b0e
1 changed files with 8 additions and 6 deletions
|
|
@ -116,16 +116,18 @@ static struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string find_item_given_name(const char* img_name, const char* product) {
|
static std::string find_item_given_name(const char* img_name, const char* product) {
|
||||||
char *dir;
|
char path_c_str[PATH_MAX + 128];
|
||||||
char path[PATH_MAX + 128];
|
|
||||||
|
|
||||||
if(product) {
|
if(product) {
|
||||||
get_my_path(path);
|
get_my_path(path_c_str);
|
||||||
return android::base::StringPrintf("../../../target/product/%s/%s", product, img_name);
|
std::string path = path_c_str;
|
||||||
|
path.erase(path.find_last_of('/'));
|
||||||
|
return android::base::StringPrintf("%s/../../../target/product/%s/%s",
|
||||||
|
path.c_str(), product, img_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = getenv("ANDROID_PRODUCT_OUT");
|
char *dir = getenv("ANDROID_PRODUCT_OUT");
|
||||||
if((dir == 0) || (dir[0] == 0)) {
|
if (dir == nullptr || dir[0] == '\0') {
|
||||||
die("neither -p product specified nor ANDROID_PRODUCT_OUT set");
|
die("neither -p product specified nor ANDROID_PRODUCT_OUT set");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue