]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
tests: avoid infinite loop in init.sh
authorPádraig Brady <P@draigBrady.com>
Mon, 15 Sep 2025 13:43:16 +0000 (14:43 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 15 Sep 2025 19:43:48 +0000 (20:43 +0100)
This was noticed when building expr in coreutils
with -fsanitize=memory, which induced false failures
resulting in an infinite loop.

* tests/init.sh: Break from the loop if there's an issue with expr(1).

ChangeLog
tests/init.sh

index 69d42a0f98e3361fd1490a23927d08386c7e432e..3aba1b6e4f275485722347a0420ffcf537f31fbd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-09-15  Pádraig Brady  <P@draigBrady.com>
+
+       tests: avoid infinite loop in init.sh
+       * tests/init.sh: Break from the loop if there's an issue with expr(1).
+
 2025-09-15  Pádraig Brady  <P@draigBrady.com>
 
        cpu-supports: relicense under LGPL
index 20588226279f5f20c0759d3eb257c0086ef6166a..6a63f05ee920ef1b024f5fec81c81fb4dff55e29 100644 (file)
@@ -394,7 +394,7 @@ mktempd_ ()
     err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
       && { echo "$candidate_dir_"; return; }
     test $MAX_TRIES_ -le $i_ && break;
-    i_=`expr $i_ + 1`
+    i_=`expr $i_ + 1` || break
   done
   fail_ "$err_"
 }