From 0f6c36ad39a06fa8e0f7f902eeb0557cbc75b613 Mon Sep 17 00:00:00 2001 From: Marcelo Silva Nascimento Mancini Date: Fri, 24 Jun 2022 16:24:40 -0300 Subject: [PATCH] Remove null terminator from getFileName(Windows) --- minigui.d | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/minigui.d b/minigui.d index d2e06e3..bde8b73 100644 --- a/minigui.d +++ b/minigui.d @@ -13546,8 +13546,12 @@ void getFileName( } ofn.lpstrFile = file.ptr; ofn.nMaxFile = file.length; - if(openOrSave ? GetOpenFileName(&ofn) : GetSaveFileName(&ofn)) { - onOK(makeUtf8StringFromWindowsString(ofn.lpstrFile)); + if(openOrSave ? GetOpenFileName(&ofn) : GetSaveFileName(&ofn)) + { + string okString = makeUtf8StringFromWindowsString(ofn.lpstrFile); + if(okString[$-1] == '\0') + okString = okString[0..$-1]; + onOK(okString); } else { if(onCancel) onCancel();