From 06ffecfe4260d64850df23023ed94b167438d996 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 14 Nov 2017 10:31:54 +0000 Subject: Don't add a '/' if it's already there. Test: class_loader_context_test Change-Id: I3fd310cf9c2da6c295ba479d0f8f4ba3137feda1 --- runtime/class_loader_context.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/class_loader_context.cc') diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc index b62764f4c6..54e75588b9 100644 --- a/runtime/class_loader_context.cc +++ b/runtime/class_loader_context.cc @@ -209,7 +209,7 @@ bool ClassLoaderContext::OpenDexFiles(InstructionSet isa, const std::string& cla // 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; -- cgit v1.2.3-59-g8ed1b