diff options
author | Dimitry Ivanov <dimitry@google.com> | 2016-09-07 14:48:27 -0700 |
---|---|---|
committer | Dimitry Ivanov <dimitry@google.com> | 2016-09-07 14:48:27 -0700 |
commit | 01fdb6ad571187498f47e570ba17441f560ba65c (patch) | |
tree | cf392237c51890dc8019a6857c9bb79ea6f99f3e /linker/linker_utils.cpp | |
parent | dd14725eeb1e5496e92ad777db165b21ad4651f0 (diff) |
Silently ignore empty path elements
resolve_paths function used to print a warning if an input path
was empty. This commit fixes this by explicitly skipping
empty paths during path resolution.
Test: Run adb shell LD_LIBRARY_PATH=: /system/bin/ping
Test: make sure there are no warnings
Bug: http://b/31346121
Change-Id: Ifd79040943dc62fc6e07d9828ff91d1050572809
Diffstat (limited to 'linker/linker_utils.cpp')
-rw-r--r-- | linker/linker_utils.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linker/linker_utils.cpp b/linker/linker_utils.cpp index e7447e402..05ac68716 100644 --- a/linker/linker_utils.cpp +++ b/linker/linker_utils.cpp @@ -164,6 +164,11 @@ void resolve_paths(std::vector<std::string>& paths, std::vector<std::string>* resolved_paths) { resolved_paths->clear(); for (const auto& path : paths) { + // skip empty paths + if (path.empty()) { + continue; + } + char resolved_path[PATH_MAX]; const char* original_path = path.c_str(); if (realpath(original_path, resolved_path) != nullptr) { |