From: Ulrich Drepper Date: Sun, 1 Feb 1998 14:53:57 +0000 (+0000) Subject: (_dl_load_cache_lookup): Use first occurence in cache. X-Git-Tag: cvs/before-sparc-2_0_x-branch~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=736a139b84fed6adec34027feb70ac1bac6fbbac;p=thirdparty%2Fglibc.git (_dl_load_cache_lookup): Use first occurence in cache. --- diff --git a/sysdeps/generic/dl-cache.c b/sysdeps/generic/dl-cache.c index 53980a7a5e7..16f0da3c5a2 100644 --- a/sysdeps/generic/dl-cache.c +++ b/sysdeps/generic/dl-cache.c @@ -1,5 +1,5 @@ /* Support for reading /etc/ld.so.cache files written by Linux ldconfig. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -88,13 +88,16 @@ _dl_load_cache_lookup (const char *name) ! strcmp (name, ((const char *) &cache->libs[cache->nlibs] + cache->libs[i].key))) { - best = ((const char *) &cache->libs[cache->nlibs] - + cache->libs[i].value); + if ((best == NULL) || (cache->libs[i].flags == 3)) + { + best = ((const char *) &cache->libs[cache->nlibs] + + cache->libs[i].value); - if (cache->libs[i].flags == 3) - /* We've found an exact match for the shared object and no - general `ELF' release. Stop searching. */ - break; + if (cache->libs[i].flags == 3) + /* We've found an exact match for the shared object and no + general `ELF' release. Stop searching. */ + break; + } } return best; }