From b0a741233feeadf33564684a4d4632955f093867 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Thu, 22 Feb 2024 18:28:36 +0300 Subject: [PATCH] Fix usbdisk filename by Willy-JL --- applications/system/js_app/modules/js_usbdisk/js_usbdisk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/applications/system/js_app/modules/js_usbdisk/js_usbdisk.c b/applications/system/js_app/modules/js_usbdisk/js_usbdisk.c index 8ff744b848..2fe0887ef5 100644 --- a/applications/system/js_app/modules/js_usbdisk/js_usbdisk.c +++ b/applications/system/js_app/modules/js_usbdisk/js_usbdisk.c @@ -1,5 +1,6 @@ #include "../../js_modules.h" #include +#include #include "mass_storage_usb.h" #define TAG "JsUsbdisk" @@ -128,7 +129,10 @@ static void js_usbdisk_start(struct mjs* mjs) { furi_hal_usb_unlock(); usbdisk->was_ejected = false; - usbdisk->usb = mass_storage_usb_start(usbdisk->path, fn); + FuriString* name = furi_string_alloc(); + path_extract_filename_no_ext(usbdisk->path, name); + usbdisk->usb = mass_storage_usb_start(furi_string_get_cstr(name), fn); + furi_string_free(name); mjs_return(mjs, MJS_UNDEFINED); }