]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
configure: replace `$#` shell syntax
authorViktor Szakats <commit@vsz.me>
Thu, 14 Nov 2024 22:28:42 +0000 (23:28 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 15 Nov 2024 10:50:45 +0000 (11:50 +0100)
With a more portable alternative.

Fixes (seen on macOS):
```
../configure: line 47131: 1: command not found
```
Ref: https://github.com/curl/curl/actions/runs/11846071276/job/33012894013#step:7:635

Follow-up to e244d50064a56723c2ba4f0df8c847d6b70de0cb #15550
Closes #15584

configure.ac

index 806f11da906466dc2455ef039f449b6cb62cf503..8026ae83c50cb26722b65e8d6702b3ba409417b4 100644 (file)
@@ -5084,13 +5084,13 @@ dnl
 LIBCURL_PC_LDFLAGS_PRIVATE=''
 dnl Do not quote $INITIAL_LDFLAGS
 set -- $INITIAL_LDFLAGS
-while [ "$#" -gt 0 ]; do
+while test -n "$1"; do
   case "$1" in
     -L* | --library-path=* | -F*)
       LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $1"
       ;;
     -framework)
-      if [ "$#" -gt 1 ]; then
+      if test -n "$2"; then
         LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $1 $2"
         shift
       fi