1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
From a60100f06f48fbb4697aced65175bf3d41185e3e Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Tue, 20 Sep 2022 18:43:15 +0800
Subject: [PATCH 4/4] ignore absolute path when loading library
---
cli/loader_lib.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/cli/loader_lib.c b/cli/loader_lib.c
index 0301b6e..5cbda61 100644
--- a/cli/loader_lib.c
+++ b/cli/loader_lib.c
@@ -50,9 +50,7 @@ static void * load_library(const char * rel_path, const char * src_dir, int err)
#endif
char path[2*JL_PATH_MAX + 1] = {0};
- strncat(path, src_dir, sizeof(path) - 1);
- strncat(path, PATHSEPSTRING, sizeof(path) - 1);
- strncat(path, rel_path, sizeof(path) - 1);
+ strncat(path, basename, sizeof(path) - 1);
#if defined(_OS_WINDOWS_)
wchar_t wpath[2*JL_PATH_MAX + 1] = {0};
--
2.37.2
|