… | |
… | |
233 | } |
233 | } |
234 | |
234 | |
235 | return path; |
235 | return path; |
236 | } |
236 | } |
237 | |
237 | |
238 | void |
238 | static void |
239 | path_normalize (char *path) |
239 | path_normalize (char *path) |
240 | { |
240 | { |
241 | char *p; /* points to the beginning of the path not yet processed; this is |
241 | char *p; /* points to the beginning of the path not yet processed; this is |
242 | either a path component or a path separator character */ |
242 | either a path component or a path separator character */ |
243 | char *q; /* points to the end of the path component p points to */ |
243 | char *q; /* points to the end of the path component p points to */ |
… | |
… | |
314 | path = path_combine (src, dst); |
314 | path = path_combine (src, dst); |
315 | path_normalize (path); |
315 | path_normalize (path); |
316 | return (path); |
316 | return (path); |
317 | } |
317 | } |
318 | |
318 | |
319 | char * |
|
|
320 | strcasestr_local (const char *s, const char *find) |
|
|
321 | { |
|
|
322 | char c, sc; |
|
|
323 | size_t len; |
|
|
324 | |
|
|
325 | if ((c = *find++) != 0) |
|
|
326 | { |
|
|
327 | c = tolower (c); |
|
|
328 | len = strlen (find); |
|
|
329 | do |
|
|
330 | { |
|
|
331 | do |
|
|
332 | { |
|
|
333 | if ((sc = *s++) == 0) |
|
|
334 | return NULL; |
|
|
335 | } |
|
|
336 | while (tolower (sc) != c); |
|
|
337 | } |
|
|
338 | while (strncasecmp (s, find, len) != 0); |
|
|
339 | s--; |
|
|
340 | } |
|
|
341 | return (char *) s; |
|
|
342 | } |
|
|
343 | |
|
|
344 | /** |
319 | /** |
345 | * open_and_uncompress() first searches for the original filename. If it exist, |
320 | * open_and_uncompress() first searches for the original filename. If it exist, |
346 | * then it opens it and returns the file-pointer. |
321 | * then it opens it and returns the file-pointer. |
347 | */ |
322 | */ |
348 | FILE * |
323 | FILE * |