equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
201 file_end += 1; |
201 file_end += 1; |
202 } else { |
202 } else { |
203 file_end = end; |
203 file_end = end; |
204 } |
204 } |
205 |
205 |
206 int name_len = (int)strlen(file_start); |
206 size_t name_len = strlen(file_start); |
207 if (name_len > 0) { |
207 if (name_len > 0) { |
208 ResourceMark rm(THREAD); |
208 ResourceMark rm(THREAD); |
209 char* libname = NEW_RESOURCE_ARRAY(char, dir_len + name_len + 1); |
209 size_t libname_len = dir_len + name_len; |
210 *libname = 0; |
210 char* libname = NEW_RESOURCE_ARRAY(char, libname_len + 1); |
211 strncat(libname, dir_name, dir_len); |
211 int n = snprintf(libname, libname_len + 1, "%.*s%s", dir_len, dir_name, file_start); |
212 strncat(libname, file_start, name_len); |
212 assert((size_t)n == libname_len, "Unexpected number of characters in string"); |
213 trace_class_path("library = ", libname); |
213 trace_class_path("library = ", libname); |
214 ClassLoader::update_class_path_entry_list(libname, true, false); |
214 ClassLoader::update_class_path_entry_list(libname, true, false); |
215 } |
215 } |
216 |
216 |
217 file_start = file_end; |
217 file_start = file_end; |