On Donnerstag, 30. September 2010, Pat Thoyts wrote:
Add an is_absolute_path function to abstract out platform differences
in checking for an absolute or relative path.
Specifically fixes t4150-am on Windows.
Thanks for tackling this!
quoted hunk ↗ jump to hunk
@@ -209,5 +209,20 @@ case $(uname -s) in
find () {
/usr/bin/find "$@"
}
+ is_absolute_path () {
+ case "$1" in
+ /* | ?:* | \\\\*)
Absolute paths can also start with a backslash, and UNC paths can start with
double-slash. Therefore, this should be:
[/\\]* | [A-Za-z]:*)
quoted hunk ↗ jump to hunk
+ return 0 ;;
+ esac
+ return 1
+ }
-- Hannes