Don't add a '/' if it's already there.
Test: class_loader_context_test
Change-Id: I3fd310cf9c2da6c295ba479d0f8f4ba3137feda1
diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc
index b62764f..54e7558 100644
--- a/runtime/class_loader_context.cc
+++ b/runtime/class_loader_context.cc
@@ -209,7 +209,7 @@
// If path is relative, append it to the provided base directory.
std::string location = cp_elem;
if (location[0] != '/' && !classpath_dir.empty()) {
- location = classpath_dir + '/' + location;
+ location = classpath_dir + (classpath_dir.back() == '/' ? "" : "/") + location;
}
std::string error_msg;