diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2000-01-16 14:28:23 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2000-01-16 14:28:23 +0000 |
commit | e1e47306bfd9b3057032d3190130f978e46f94c4 (patch) | |
tree | feeac7683af4774ce928a248aa955bee45e1cd3e | |
parent | d8dda2d9ab89c3bd3251ed5f094ccef091356609 (diff) |
Bug-fix: skipping inappropriate versions is independent of whether
we found something correct or not.
-rw-r--r-- | gnu/usr.bin/ld/shlib.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/gnu/usr.bin/ld/shlib.c b/gnu/usr.bin/ld/shlib.c index 1f47c7944ea..2febacdb05c 100644 --- a/gnu/usr.bin/ld/shlib.c +++ b/gnu/usr.bin/ld/shlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shlib.c,v 1.6 2000/01/02 06:18:41 assar Exp $ */ +/* $OpenBSD: shlib.c,v 1.7 2000/01/16 14:28:22 espie Exp $ */ /* $NetBSD: shlib.c,v 1.13 1998/04/04 01:00:29 fvdl Exp $ */ /* @@ -246,12 +246,11 @@ int do_dot_a; DIR *dd = opendir(search_dirs[i]); struct dirent *dp; int found_dot_a = 0; - int might_take_it; + int found_match = 0; if (dd == NULL) continue; - might_take_it = 0; while ((dp = readdir(dd)) != NULL) { int n; @@ -281,19 +280,13 @@ int do_dot_a; found_dot_a = 0; } - if (major == -1 && minor == -1) { - might_take_it = 1; - } else if (major != -1 && minor == -1) { - if (tmp[0] == major) - might_take_it = 1; - } else if (major != -1 && minor != -1) { - if (tmp[0] == major) - if (n == 1 || tmp[1] >= minor) - might_take_it = 1; - } - - if (!might_take_it) - continue; + /* skip inappropriate versions. */ + if (major != -1) { + if (tmp[0] != major) + continue; + if (n != 1 && minor != -1 && tmp[1] < minor) + continue; + } if (cmpndewey(tmp, n, dewey, ndewey) <= 0) continue; @@ -303,6 +296,7 @@ int do_dot_a; 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]; @@ -310,7 +304,7 @@ int do_dot_a; } closedir(dd); - if (found_dot_a || might_take_it) + if (found_dot_a || found_match) /* * There's a lib in this dir; take it. */ |