From c78dbcd3f26f43a28b08a846a56d3448313ad033 Mon Sep 17 00:00:00 2001 From: Mateusz Nowak <118080320+mateusznowakdev@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:16:20 +0200 Subject: [PATCH] Support UF2 drives with space in their name on Linux Some devices, such as Seeed Studio XIAO with Adafruit bootloader, use complex names for UF2 device. With this fix applied, /proc/mounts should be parsed correctly --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index b10f45cd73..3d030dba36 100644 --- a/main.go +++ b/main.go @@ -1033,9 +1033,10 @@ func findFATMounts(options *compileopts.Options) ([]mountPoint, error) { if fstype != "vfat" { continue } + fspath := strings.ReplaceAll(fields[1], "\\040", " ") points = append(points, mountPoint{ - name: filepath.Base(fields[1]), - path: fields[1], + name: filepath.Base(fspath), + path: fspath, }) } return points, nil