equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2015, 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. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
272 FileList_ensureCapacity(fl, fl->size+1); |
272 FileList_ensureCapacity(fl, fl->size+1); |
273 fl->files[fl->size++] = file; |
273 fl->files[fl->size++] = file; |
274 } |
274 } |
275 |
275 |
276 static void |
276 static void |
277 FileList_addSubstring(FileList fl, const char *beg, int len) |
277 FileList_addSubstring(FileList fl, const char *beg, size_t len) |
278 { |
278 { |
279 char *filename = (char *) JLI_MemAlloc(len+1); |
279 char *filename = (char *) JLI_MemAlloc(len+1); |
280 memcpy(filename, beg, len); |
280 memcpy(filename, beg, len); |
281 filename[len] = '\0'; |
281 filename[len] = '\0'; |
282 FileList_ensureCapacity(fl, fl->size+1); |
282 FileList_ensureCapacity(fl, fl->size+1); |
308 |
308 |
309 static FileList |
309 static FileList |
310 FileList_split(const char *path, char sep) |
310 FileList_split(const char *path, char sep) |
311 { |
311 { |
312 const char *p, *q; |
312 const char *p, *q; |
313 int len = (int)JLI_StrLen(path); |
313 size_t len = JLI_StrLen(path); |
314 int count; |
314 int count; |
315 FileList fl; |
315 FileList fl; |
316 for (count = 1, p = path; p < path + len; p++) |
316 for (count = 1, p = path; p < path + len; p++) |
317 count += (*p == sep); |
317 count += (*p == sep); |
318 fl = FileList_new(count); |
318 fl = FileList_new(count); |