diff --git a/linker/linker.cpp b/linker/linker.cpp index 37a318916..cee9c3b31 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -4208,7 +4208,7 @@ static std::string get_ld_config_file_vndk_path() { if (insert_pos == std::string::npos) { insert_pos = ld_config_file_vndk.length(); } - ld_config_file_vndk.insert(insert_pos, Config::get_vndk_version_string('.')); + ld_config_file_vndk.insert(insert_pos, Config::get_vndk_version_string(".")); return ld_config_file_vndk; } diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp index 46c91a3dd..450d0e6d3 100644 --- a/linker/linker_config.cpp +++ b/linker/linker_config.cpp @@ -408,7 +408,7 @@ class Properties { params.push_back({ "SDK_VER", buf }); } - static std::string vndk = Config::get_vndk_version_string('-'); + static std::string vndk = Config::get_vndk_version_string(""); params.push_back({ "VNDK_VER", vndk }); for (auto& path : paths) { @@ -596,11 +596,11 @@ bool Config::read_binary_config(const char* ld_config_file_path, return true; } -std::string Config::get_vndk_version_string(const char delimiter) { +std::string Config::get_vndk_version_string(const std::string& prefix) { std::string version = android::base::GetProperty("ro.vndk.version", ""); if (version != "" && version != "current") { - //add the delimiter char in front of the string and return it. - return version.insert(0, 1, delimiter); + //add the prefix in front of the string and return it. + return version.insert(0, prefix); } return ""; } diff --git a/linker/linker_config.h b/linker/linker_config.h index 75d93789b..547c62ebd 100644 --- a/linker/linker_config.h +++ b/linker/linker_config.h @@ -164,7 +164,7 @@ class Config { const Config** config, std::string* error_msg); - static std::string get_vndk_version_string(const char delimiter); + static std::string get_vndk_version_string(const std::string& prefix); private: void clear();