[fix]: fix shell scripts in aws_ami (#32824)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Updated the loop condition in the URL encoding functionality for
improved reliability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Goutham Pratapa 2024-04-22 09:34:58 +05:30 committed by GitHub
parent 489255f3ca
commit 78883c9336
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,7 +48,7 @@ urlencode() {
LC_COLLATE=C LC_COLLATE=C
local length="${#1}" local length="${#1}"
for (( i = 0; i < length; i++ )); do for (( i = 0; i < $length; i++ )); do
local c="${1:i:1}" local c="${1:i:1}"
case $c in case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;; [a-zA-Z0-9.~_-]) printf "$c" ;;