From 70f54e15da9c89a4ad24c62693a64da9f27fb5a8 Mon Sep 17 00:00:00 2001 From: Stefano Moioli Date: Sun, 31 Dec 2017 16:50:52 +0100 Subject: [PATCH] GPath.is_absolute: use IsPathRooted --- GLibPorts/GPath.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/GLibPorts/GPath.cs b/GLibPorts/GPath.cs index 3f4a605..b0c6fd7 100644 --- a/GLibPorts/GPath.cs +++ b/GLibPorts/GPath.cs @@ -12,15 +12,7 @@ public static bool is_absolute(string file_name) { if (file_name == null || file_name.Length < 1) return false; - if (file_name[0] == System.IO.Path.DirectorySeparatorChar) - return true; - - //TODO: test System.IO.Path.IsPathRooted - if (!Utils.IsUnix() && - Char.IsLetter(file_name[0]) && - file_name[1] == ':' && file_name[2] == System.IO.Path.DirectorySeparatorChar) - return true; - return false; + return Path.IsPathRooted(file_name); } public static string build_path(string separator, params string[] parts) {