From 26592d589c61e8f50f071e462f8073f419e7badb Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Sat, 28 Sep 2024 16:13:43 +0200
Subject: [PATCH] Detect malformed paths by their beginning

---
 scripts/Windows/Scripts/WSL.ps1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Windows/Scripts/WSL.ps1 b/scripts/Windows/Scripts/WSL.ps1
index 385fada8..89ae4c65 100644
--- a/scripts/Windows/Scripts/WSL.ps1
+++ b/scripts/Windows/Scripts/WSL.ps1
@@ -186,7 +186,7 @@ function ConvertTo-LinuxPath {
             $result = Receive-Job -Wait $job;
 
 
-            if ((Split-Path -Leaf $Path) -ne (Split-Path -Leaf $result)) {
+            if (-not ($result.StartsWith("/"))) {
                 Write-Error "The result of the path conversion of ``$Path`` was unexpected: ``$result``";
                 continue;
             }