test-lib: Work around incompatible sort and find on Windows
If the PATH lists the Windows system directories before the MSYS directories, Windows's own incompatible sort and find commands would be picked up. We implement these commands as functions and call the real tools by absolute path. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Johannes Sixt committed
Mar 11, 2009 at 21:17 UTC
f17e9fbbe919bc1f4ecaa35a9cb0869a5ec47fc0
1 file changed
+13
t/test-lib.sh
+13
@@ -635,3 +635,16 @@ do
635
test_done
636
esac
637
done
638
+
639
+# Fix some commands on Windows
640
+case $(uname -s) in
641
+*MINGW*)
642
+ # Windows has its own (incompatible) sort and find
643
+ sort () {
644
+ /usr/bin/sort "$@"
645
+ }
646
+ find () {
647
+ /usr/bin/find "$@"
648
+ }
649
+ ;;
650
+esac