diff options
author | Felix Fietkau <nbd@nbd.name> | 2023-05-27 07:59:42 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-05-27 08:00:26 +0200 |
commit | 740e2501fdcaf72b540166ff3bac1dd42efb8cf1 (patch) | |
tree | 8139b64d37e9fbe37a1ee3e813a0c307442fc8bd | |
parent | 5163867269fc04fa01ec5e9f8df3384c933339f2 (diff) |
main: add user specified library search paths before default path
Allow -L to add library paths that take precedence over the built-in ones.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | main.c | 6 | ||||
-rw-r--r-- | tests/cram/test_basic.t | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -90,7 +90,7 @@ print_usage(const char *app) " Preload the given `library`, optionally aliased to `name`.\n\n" "-L pattern\n" - " Append given `pattern` to default library search paths. If the pattern\n" + " Prepend given `pattern` to default library search paths. If the pattern\n" " contains no `*`, it is added twice, once with `/*.so` and once with\n" " `/*.uc` appended to it.\n\n" @@ -505,8 +505,6 @@ main(int argc, char **argv) .raw_mode = true }; - uc_search_path_init(&config.module_search_path); - app = appname(argv[0]); if (argc == 1) { @@ -544,6 +542,8 @@ main(int argc, char **argv) } } + uc_search_path_init(&config.module_search_path); + optind = 1; uc_vm_init(&vm, &config); diff --git a/tests/cram/test_basic.t b/tests/cram/test_basic.t index d7f78a3..798436e 100644 --- a/tests/cram/test_basic.t +++ b/tests/cram/test_basic.t @@ -61,7 +61,7 @@ check that ucode provides exepected help: Preload the given `library`, optionally aliased to `name`. -L pattern - Append given `pattern` to default library search paths. If the pattern + Prepend given `pattern` to default library search paths. If the pattern contains no `*`, it is added twice, once with `/*.so` and once with `/*.uc` appended to it. |