]> 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>
Thu, 18 Jan 2024 08:51:47 +0000 (09:51 +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 30a9f6bc9f2bfb25d85845a5dddcfdaf70391ef7..d56b255ff46c72959f771813ddc75921d207a1aa 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 d8889e858bd18ce86945170988f04391f52cd3c4..b8a400cff10ea12104ec267eb3969db69f666f88 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="$saved_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"