Skip to content

Commit

Permalink
GPath.is_absolute: use IsPathRooted
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-smx committed Feb 16, 2018
1 parent b0766e1 commit 70f54e1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions GLibPorts/GPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 70f54e1

Please sign in to comment.