From 736a139b84fed6adec34027feb70ac1bac6fbbac Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 1 Feb 1998 14:53:57 +0000 Subject: [PATCH] (_dl_load_cache_lookup): Use first occurence in cache. --- sysdeps/generic/dl-cache.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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; } -- 2.47.2