From 02793ccec496e9ca1ea5e3474b70b39dfea388a9 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 25 Feb 2020 13:02:37 -0500 Subject: Break out of scanning loop when a match is discovered --- src/rpath.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/rpath.c') diff --git a/src/rpath.c b/src/rpath.c index 2976ed8..42a4c07 100644 --- a/src/rpath.c +++ b/src/rpath.c @@ -121,7 +121,7 @@ char *rpath_get(const char *_filename) { * @return */ char *rpath_generate(const char *_filename) { - char *origin = "$ORIGIN/"; + char *origin = "$ORIGIN/../lib:$ORIGIN/"; char *filename = realpath(_filename, NULL); if (!filename) { @@ -239,6 +239,7 @@ char *rpath_autodetect(const char *filename) { if (exists(check_path) == 0) { // The library exists so mark it for processing has_real_libdir = 1; // gate for memory allocation below + break; } free(check_path); } -- cgit