core extensions: fix: don't redefine extension_function_info when recursing

- otherwise when there's a chain of enable_extension() we lose the original info
This commit is contained in:
Ricardo Pardini
2023-11-12 15:55:55 +01:00
committed by Igor
parent af3b4fafec
commit 1e184f14af

View File

@@ -505,7 +505,9 @@ function enable_extension() {
# iterate over defined functions, store them in global associative array extension_function_info # iterate over defined functions, store them in global associative array extension_function_info
for newly_defined_function in ${new_function_list}; do for newly_defined_function in ${new_function_list}; do
#echo "func: ${newly_defined_function} has DIR: ${extension_dir}" # Check if "${newly_defined_function}" is already defined in the extension_function_info array, if not, add it
# This is to address the recursive case messing up references
[[ -v extension_function_info["${newly_defined_function}"] ]] && continue
extension_function_info["${newly_defined_function}"]="EXTENSION=\"${extension_name}\" EXTENSION_DIR=\"${extension_dir}\" EXTENSION_FILE=\"${extension_file}\" EXTENSION_ADDED_BY=\"${stacktrace}\"" extension_function_info["${newly_defined_function}"]="EXTENSION=\"${extension_name}\" EXTENSION_DIR=\"${extension_dir}\" EXTENSION_FILE=\"${extension_file}\" EXTENSION_ADDED_BY=\"${stacktrace}\""
done done