diff options
author | 2000-01-16 14:31:26 +0000 | |
---|---|---|
committer | 2000-01-16 14:31:26 +0000 | |
commit | 7f6e27efeea5dbc27cfa66057078202b01039434 (patch) | |
tree | 133d11fd5bccaefbf17647035fa1f8e7e90a8d66 | |
parent | Bug-fix: skipping inappropriate versions is independent of whether (diff) | |
download | wireguard-openbsd-7f6e27efeea5dbc27cfa66057078202b01039434.tar.xz wireguard-openbsd-7f6e27efeea5dbc27cfa66057078202b01039434.zip |
Kill XXX code which is bogus and unused anyway (no call with dodotpath==1
and major !=-1 anywhere).
Simplify test logic: it's enough to check path != NULL to know whether
we found something. cmpdewey() code is enough to ensure we get the best
one (libfoo.a doesn't change n, any appropriate libfoo.so will take
precedence).
-rw-r--r-- | gnu/usr.bin/ld/shlib.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/gnu/usr.bin/ld/shlib.c b/gnu/usr.bin/ld/shlib.c index 2febacdb05c..01343faf557 100644 --- a/gnu/usr.bin/ld/shlib.c +++ b/gnu/usr.bin/ld/shlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shlib.c,v 1.7 2000/01/16 14:28:22 espie Exp $ */ +/* $OpenBSD: shlib.c,v 1.8 2000/01/16 14:31:26 espie Exp $ */ /* $NetBSD: shlib.c,v 1.13 1998/04/04 01:00:29 fvdl Exp $ */ /* @@ -232,7 +232,7 @@ int do_dot_a; int tmp[MAXDEWEY]; int i; int len; - char *lname, *path = NULL; + char *lname; int major = *majorp, minor = *minorp; len = strlen(name); @@ -245,8 +245,7 @@ int do_dot_a; for (i = 0; i < n_search_dirs; i++) { DIR *dd = opendir(search_dirs[i]); struct dirent *dp; - int found_dot_a = 0; - int found_match = 0; + char *path = NULL; if (dd == NULL) continue; @@ -261,7 +260,6 @@ int do_dot_a; (dp->d_name+len)[1] == 'a') { path = concat(search_dirs[i], "/", dp->d_name); - found_dot_a = 1; } if (dp->d_namlen < len + 4) @@ -274,12 +272,6 @@ int do_dot_a; if ((n = getdewey(tmp, dp->d_name+len+4)) == 0) continue; - if (major != -1 && found_dot_a) { /* XXX */ - free(path); - path = NULL; - found_dot_a = 0; - } - /* skip inappropriate versions. */ if (major != -1) { if (tmp[0] != major) @@ -295,8 +287,6 @@ int do_dot_a; if (path) free(path); path = concat(search_dirs[i], "/", dp->d_name); - found_dot_a = 0; - found_match = 1; bcopy(tmp, dewey, sizeof(dewey)); ndewey = n; *majorp = dewey[0]; @@ -304,12 +294,12 @@ int do_dot_a; } closedir(dd); - if (found_dot_a || found_match) + if (path != NULL) /* * There's a lib in this dir; take it. */ return path; } - return path; + return NULL; } |