diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2024-12-02 13:56:11 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-12-02 14:58:50 +0100 |
commit | abf2e8c64eeb7300a933cef26d020251468d41f0 (patch) | |
tree | 9942a85a724bbbc3f979b8f144ff4f555fd8c1f6 | |
parent | c117e9d1e00cdeaed66d4ebea383ff4555abbf4b (diff) | |
download | rules-cc-abf2e8c64eeb7300a933cef26d020251468d41f0.tar.gz |
expand_exec: Fix quoting for older dash shells
... versions prior to 0.5.11.
-rwxr-xr-x | CC/foreign/expand_exec | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/CC/foreign/expand_exec b/CC/foreign/expand_exec index 32891ca..df3000e 100755 --- a/CC/foreign/expand_exec +++ b/CC/foreign/expand_exec @@ -46,9 +46,9 @@ parse_arg() { local PARSE_VAR_NAME=false while [ ${#ARG} -gt 0 ]; do - local NEXT=${ARG#?} - c="${ARG%$NEXT}" - ARG=$NEXT + local NEXT="${ARG#?}" + c="${ARG%"${NEXT}"}" + ARG="${NEXT}" if $PARSE_VAR_NAME; then # parse <var> from $(<var>) @@ -91,9 +91,9 @@ parse_arg() { PARSED_ARG="'" while [ ${#RESULT} -gt 0 ]; do - local NEXT=${RESULT#?} - c="${RESULT%$NEXT}" - RESULT=$NEXT + local NEXT="${RESULT#?}" + c="${RESULT%"${NEXT}"}" + RESULT="${NEXT}" if [ "$c" = "'" ]; then PARSED_ARG="${PARSED_ARG}'\\''" else |