From b85ccd28d8585bdbc6b7c37af9acc91677ba9fd8 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Mon, 9 Nov 2026 11:20:50 +0000 Subject: [PATCH] Fix netstandard2.0/net48 build in writable archive key normalisation string.StartsWith(char) is not available on netstandard2.0 or net48, so those targets failed to compile after 990186ac. Co-Authored-By: Claude Opus 5.5 --- src/SharpCompress/Archives/AbstractWritableArchive.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SharpCompress/Archives/AbstractWritableArchive.cs b/src/SharpCompress/Archives/AbstractWritableArchive.cs index 42ff5d5d..f2a7ac87 100644 --- a/src/SharpCompress/Archives/AbstractWritableArchive.cs +++ b/src/SharpCompress/Archives/AbstractWritableArchive.cs @@ -170,7 +170,7 @@ public abstract partial class AbstractWritableArchive } return key.Trim('/'); } - return key.StartsWith('/') ? key.Substring(1) : key; + return key.Length > 0 && key[0] == '/' ? key.Substring(1) : key; } ValueTask IWritableAsyncArchive.RemoveEntryAsync(IArchiveEntry entry) =>