• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

Revision9914284d6afb1734747940de2c466f67078e4365 (tree)
Time2016-08-23 09:26:19
AuthorDaniel Rosenberg <drosen@goog...>
CommiterDaniel Rosenberg

Log Message

DO NOT MERGE: Fix bug in product path building

-p <product> was failing to find the product image files since
get_my_path's result was ignored. As it was, it would only work
if you happened to call it from $OUT.

Change-Id: Id4183cb7fafb313c0b1feff93d7e22fd4658d267
Bug: 31022767

Change Summary

Incremental Difference

--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -116,16 +116,18 @@ static struct {
116116 };
117117
118118 static std::string find_item_given_name(const char* img_name, const char* product) {
119- char *dir;
120- char path[PATH_MAX + 128];
119+ char path_c_str[PATH_MAX + 128];
121120
122121 if(product) {
123- get_my_path(path);
124- return android::base::StringPrintf("../../../target/product/%s/%s", product, img_name);
122+ get_my_path(path_c_str);
123+ std::string path = path_c_str;
124+ path.erase(path.find_last_of('/'));
125+ return android::base::StringPrintf("%s/../../../target/product/%s/%s",
126+ path.c_str(), product, img_name);
125127 }
126128
127- dir = getenv("ANDROID_PRODUCT_OUT");
128- if((dir == 0) || (dir[0] == 0)) {
129+ char *dir = getenv("ANDROID_PRODUCT_OUT");
130+ if (dir == nullptr || dir[0] == '\0') {
129131 die("neither -p product specified nor ANDROID_PRODUCT_OUT set");
130132 }
131133