From 5fd0e6d0c8abf9e7f298b123876de5bd67d2d986 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 28 Feb 2022 11:28:11 -0800 Subject: [PATCH] Make GetExtension failure softer --- BeefLibs/corlib/src/IO/Path.bf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BeefLibs/corlib/src/IO/Path.bf b/BeefLibs/corlib/src/IO/Path.bf index 5b7abecd..62b3bba8 100644 --- a/BeefLibs/corlib/src/IO/Path.bf +++ b/BeefLibs/corlib/src/IO/Path.bf @@ -301,10 +301,10 @@ namespace System.IO outFileName.Append(inPath, lastSlash + 1); } - public static Result GetExtension(StringView inPath, String outExt) + public static bool GetExtension(StringView inPath, String outExt) { if (inPath.IsEmpty) - return .Err; + return false; CheckInvalidPathChars(inPath); @@ -316,7 +316,7 @@ namespace System.IO if (i != inPath.Length - 1) { outExt.Append(inPath.Substring(i, inPath.Length - i)); - return .Ok; + return true; } else break; @@ -325,7 +325,7 @@ namespace System.IO break; } - return .Err; + return false; } public static bool HasExtension(StringView path)