]> Savannah Git Hosting - gnulib.git/commitdiff
test-framework-sh: Improve portability to native Windows and OS/2.
authorBruno Haible <bruno@clisp.org>
Mon, 15 Jan 2024 14:56:40 +0000 (15:56 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 15 Jan 2024 15:02:49 +0000 (16:02 +0100)
Reported by KO Myung-Hun <komh78@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.

* tests/init.sh (setup_): In new_PATH, use $PATH_SEPARATOR instead of
':'.

ChangeLog
tests/init.sh

index e0788e2d746f961e0e074e50f912e9623170d9c4..c43af9729d76bc47439696e93ed0adb5587fc3ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-01-15  Bruno Haible  <bruno@clisp.org>
 
+       test-framework-sh: Improve portability to native Windows and OS/2.
+       Reported by KO Myung-Hun <komh78@gmail.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
+       * tests/init.sh (setup_): In new_PATH, use $PATH_SEPARATOR instead of
+       ':'.
+
        test-framework-sh: Improve portability to native Windows and OS/2.
        Reported by KO Myung-Hun <komh78@gmail.com> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00037.html>.
index 7d7b18645169d54879155ecb17656a2199ab0661..98c97a9028abfc49461b3ebe25e4daa2f99dbef6 100644 (file)
@@ -436,13 +436,13 @@ setup_ ()
   # and Zero-length entries.
   saved_IFS="$IFS"; IFS="$PATH_SEPARATOR"
   new_PATH=
-  sep_=
   for dir in $PATH; do
     IFS="$save_IFS"
     case "$dir" in
-      /*) test -d "$dir/." || continue
-          new_PATH="${new_PATH}${sep_}${dir}"
-          sep_=':';;
+      /*)
+        test -d "$dir/." || continue
+        new_PATH="${new_PATH}${new_PATH:+$PATH_SEPARATOR}${dir}"
+        ;;
     esac
   done
   IFS="$saved_IFS"