summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2023-08-08 20:50:41 +0300
committernl6720 <nl6720@gmail.com>2023-08-08 20:55:36 +0300
commit3c6ec03faea32742161e0be693e4f9496ad417de (patch)
treec52be8a699a43d4cbe8d49fb9e68a3950a0480a5
parent2c1feafa83cfb0f48a1b8575c1aab1b9aefea130 (diff)
functions: return succesfully if add_module_from_symbol has no modules to add
Instead, fail if no modules with the matching criteria are found. Fixes: f90ed9b0df08f9e75ec08ddb9301174c8996f59c ("Add optional -c flag to add_module_from_symbol to use add_checked_modules")
-rw-r--r--functions3
1 files changed, 2 insertions, 1 deletions
diff --git a/functions b/functions
index 462fcc1..bcb2345 100644
--- a/functions
+++ b/functions
@@ -1095,8 +1095,9 @@ add_module_from_symbol() {
shift
fi
mapfile -t mods < <(find_module_from_symbol "$@")
+ (( ${#mods[@]} )) || return 1
if (( use_add_checked_modules )); then
- map add_checked_modules "${mods[@]}"
+ map add_checked_modules "${mods[@]}" || :
else
map add_module "${mods[@]}"
fi