diff options
author | Artturi <Artturin@artturin.com> | 2023-09-20 09:41:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 09:41:44 +0300 |
commit | 6096abb0089146ef85e897ccf258289011c3a02a (patch) | |
tree | a466861fb7632c994ba5a4dbb12ae0c40465bd94 /pkgs/build-support/setup-hooks | |
parent | 6f27ba80ea1125aa94dd1cc499dcf9a4d20a70a0 (diff) | |
parent | df8b425f8990cf8c6cd8a4477a70995bdd4fe2a4 (diff) | |
download | nixlib-6096abb0089146ef85e897ccf258289011c3a02a.tar nixlib-6096abb0089146ef85e897ccf258289011c3a02a.tar.gz nixlib-6096abb0089146ef85e897ccf258289011c3a02a.tar.bz2 nixlib-6096abb0089146ef85e897ccf258289011c3a02a.tar.lz nixlib-6096abb0089146ef85e897ccf258289011c3a02a.tar.xz nixlib-6096abb0089146ef85e897ccf258289011c3a02a.tar.zst nixlib-6096abb0089146ef85e897ccf258289011c3a02a.zip |
Merge pull request #255208 from rhendric/rhendric/make-binary-wrapper
Diffstat (limited to 'pkgs/build-support/setup-hooks')
-rw-r--r-- | pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh b/pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh index 88a50befd732..6cd01f6bf630 100644 --- a/pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-binary-wrapper/make-binary-wrapper.sh @@ -193,8 +193,23 @@ makeCWrapper() { addFlags() { local n flag before after var + + # Disable file globbing, since bash will otherwise try to find + # filenames matching the the value to be prefixed/suffixed if + # it contains characters considered wildcards, such as `?` and + # `*`. We want the value as is, except we also want to split + # it on on the separator; hence we can't quote it. + local reenableGlob=0 + if [[ ! -o noglob ]]; then + reenableGlob=1 + fi + set -o noglob # shellcheck disable=SC2086 before=($1) after=($2) + if (( reenableGlob )); then + set +o noglob + fi + var="argv_tmp" printf '%s\n' "char **$var = calloc(${#before[@]} + argc + ${#after[@]} + 1, sizeof(*$var));" printf '%s\n' "assert($var != NULL);" |