From 3b1aac20842facce8f8962f058b850d0f59d4e1f Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Wed, 31 Mar 2021 07:46:58 +0000 Subject: [PATCH] Reinitialise i before using it for iterating over dll_dirs Previously, the value of it was kept from the loop over all the command-line arguments; as `/usr/lib` or `/lib` were far enough in the list, on many systems there was no difference, but `own_dir` and `LIB_DIR` could be ignored or not based on the argument count, which was confusing. --- src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.c b/src/main.c index 009a352..b54a811 100644 --- a/src/main.c +++ b/src/main.c @@ -107,6 +107,7 @@ int main(int argc, char *argv[]) { // search DLL set_own_dir(argv[0]); + i = 0; while(dll_dirs[i]) { snprintf(buf, sizeof(buf), "%s/%s", dll_dirs[i], dll_name); if(access(buf, R_OK) != -1) {